Step 2. Create iiiFN11 Employee List
In this step, you will create a function to display information (EMPNO, GIVENAME, SURNAME) about the employees in a given department and section. The values for department and section are passed in the iiiDEPTWK and iiiSECTWK fields in the iiiPROC03_HIDDEN.
1. Working with your iiiPROC03 process, create a new function named iiiFN11 Employee List. You will manually enter the code for the function.
2. Write the RDML Code to build a browse list from the two parameters passed, iiiDEPTWK and iiiSECTWK. (This example does not include any field/file level validation. You could include validation routines inside the RDML to validate that records were found for the browse list.)
Solution:
One possible solution to this exercise is shown below (where iii is your course assigned ID):
FUNCTION (*DIRECT *WEBEVENT)
DEF_LIST NAME(#iiiEMPLST) FIELDS((#EMPNO) (#GIVENAME) (#SURNAME)) ENTRYS(9999)
IF COND('#iiiLOGIN *EQ *BLANKS')
CALL PROCESS(*DIRECT) FUNCTION(iiiFN10)
ENDIF
CLR_LIST NAMED(#iiiEMPLST)
SELECT FIELDS((#iiiEMPLST)) FROM_FILE(PSLMST1) WITH_KEY(#iiiDEPTWK #iiiSECTWK) IO_STATUS(*STATUS) IO_ERROR(*NEXT) VAL_ERROR(*NEXT)
ADD_ENTRY TO_LIST(#iiiEMPLST)
ENDSELECT
DISPLAY FIELDS((#iiiDEPTWK) (#iiiSECTWK)) BROWSELIST(#iiiEMPLST) EXIT_KEY(*NO) MENU_KEY(*NO)
3. Exit and save your RDML function.
4. Compile your RDML function iiiPROC03/iiiFN11.