Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If our 3 example pull down choices "Select", "Display" and "Change" has PD$OPT values of SEL, DIS and CHG respectively, then the obvious mainline for our combined RDML function would look something like this:

EXCHANGE FIELDS(#OBJECTKEY) OPTION(*ALWAYS)
 
CASE     OF_FIELD(#PD$OPT)
WHEN     VALUE_IS('= SEL')
EXECUTE  SUBROUTINE(SEL_OBJECT)
WHEN     VALUE_IS('= DIS')
EXECUTE  SUBROUTINE(DIS_OBJECT)
WHEN     VALUE_IS('= CHG')
EXECUTE  SUBROUTINE(CHG_OBJECT)
ENDCASE

All that is required now is to combine our previous example functions into subroutines of this mainline like this:

SUBROUTINE NAME(SEL_OBJECT)
<< "Select"

...

 routine as per previous example >>
ENDROUTINE
 
SUBROUTINE NAME(DIS_OBJECT)
<< "Display"

...

 routine as per previous example >>
ENDROUTINE
 
SUBROUTINE NAME(CHG_OBJECT)
<< "Change"

...

 routine as per previous example >>
ENDROUTINE

Next we compile this new "combined" function and finally change the action bar control table to indicate that all the pull down choices should invoke this new "combined" function.

The restart logic is very simple.

When a DISPLAY or REQUEST command is logically terminated by the user from the action bar, and the new selected function is the same as the one that is currently active, control passes back to the first executable command in the program again (ie: the CASE command).

...