In this step, you will add the RDMLX code consisting of multiple WebRoutines to the newly created WAM.
Webroutine Name(WMdemo) Desc('WEB_MAP WR1')
EndroutineWEB_MAP FOR(*BOTH) FIELDS(#EMPNO #GIVENAME #SURNAME #ADDRESS1 #POSTCODE (#STDRENTRY *HIDDEN))
Begin_Com Role(*EXTENDS #PRIM_WAM)
Group_By Name(#Empdata) Fields(#empno #surname #givename #address1 #postcode)
Webroutine Name(WMdemo) Desc('WEB_MAP WR1')
Web_Map For(*BOTH) Fields(#empdata (#stdrentry *hidden))
. . . WebRoutine
Note: A WEB_MAP statement with Keyword FOR(*BOTH) specifies that the fields listed in the WEB_MAP are both input to and output from the WebRoutine. |
If Cond(#empno = *blanks)Note the following about this code:
Select Fields(#empdata) From_File(pslmst)
Leave
Endselect
Endif
Fetch Fields(#EMPDATA) From_file(PSLMST)With no key specified, the FETCH will return the first record in the file.
If Cond(#stdrentry = R)
Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno)
Endif
Group_By Name(#Empdata) Fields(#empno #surname #givename #address1 #postcode)
Webroutine Name(WMdemo) Desc('WEB_MAP WR1')
Web_Map For(*BOTH) Fields(#empdata (#stdrentry *hidden))
If Cond(#empno = *blanks)
Select Fields(#empdata) From_File(pslmst)
Leave
Endselect
Endif
If Cond(#stdrentry = R)
Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno)
Endif
EndroutineWebRoutine