4.5.2 Changes Required to Restructure for WEBEVENT

For this function to be re-written using the FUNCTION OPTIONS(*WEBEVENT) style, the following changes must be made:

The overall changes required are shown below.

FUNCTION        OPTIONS(*DIRECT *WEBEVENT)

GROUP_BY        NAME(#PANEL) FIELDS(#EMPNO #SURNAME...)

If the function has data to be inserted...

INSERT          FIELDS(#PANEL) TO_FILE(PSLMST) VAL_ERROR(...)

MESSAGE         MSGID(DCU0011) MSGF(DC@M01) MSGDTA('employee')

CHANGE          FIELD(#PANEL) TO(*NULL)

End of the If logic.

REQUEST         FIELDS(#PANEL) DESIGN(*DOWN) IDENTIFY(*DESC)

In order to determine if the function is executing for the first time or if it has data to be inserted, you need to use a variable to determine the state of the function. Refer to 4.5.3 Handling Re-entrant Functions.