Step 2 Add RDMLX code to the new WAM

LANSA WAM

Step 2. Add RDMLX code to the new WAM

WAM015 - Working Lists

In this step, you will add the RDMLX code to the newly created WAM.

1.  Create a WebRoutine named ListMain with a description of List Demonstration.

2.  Define a list that will contain information from the Personnel Master file.

Def_List Name(#emplist) Fields(#empno #givename #surname #address1 #phonehme) Type(*working) Entrys(*max) 

Note: In RDMLX programs you should usually define lists using Entrys(*max). As well as having an upper limit which is only limited by the platform, lists defined in this way are dynamic and only occupy the memory required for their current number of entries.

3.  Add code to the WebRoutine to populate the list with data from PSLMST.

Clr_List Named(#EMPLIST)

Select Fields(#emplist) From_File(pslmst)

Add_Entry To_List(#emplist)

Endselect
 

4.  Create a WEB_MAP and add list EMPLIST to it, so the list can be displayed on the page.

     Your finished WebRoutine should appear as follows:

Webroutine Name(ListMain) Desc('List Demonstration')

Web_Map For(*both) Fields(#emplist)

Def_List Name(#emplist) Fields(#empno #givename #surname #address1 #phonehme) Type(*working) Entrys(*max)

Clr_List Named(#EMPLIST)

Select Fields(#emplist) From_File(pslmst)

Add_Entry To_List(#emplist)

Endselect

Endroutine 

5.  Compile the WAM. When you compile a WAM, it is always saved first.