FRM115 - Writing Reports
In this step, you modify the function to include a header and footer. You will need to make the following changes:
Remember to include KEEP_LAST logic.
1. Review the repository field definitions for the REP1PAGE, DATE, TIME and FUNCTION fields.
2. Try to make the necessary code changes based on the function description above.
3. Your code should appear as follows:
FUNCTION OPTIONS(*DIRECT)
DEF_REPORT FORMSIZE(66 80)
GROUP_BY NAME(#REPDATA) FIELDS(#DEPTMENT #DEPTDESC #SECTION #EMPNO #SALARY
#STARTDTE)
DEF_HEAD NAME(#HDR01) FIELDS(#REP1PAGE #FUNCTION #STD_TITLE #DEPTMENT #DEPTDESC)
TRIGGER_BY(*OVERFLOW #DEPTMENT) DESIGN(*DOWN)
DEF_FOOT NAME(#FTR01) FIELDS(#DATE #TIME #REP1PAGE)
DEF_LINE NAME(#DET01) FIELDS(#SECTION #EMPNO #SALARY #STARTDTE)
#STD_TITLE := 'Employee Report'
SELECT FIELDS(#REPDATA) FROM_FILE(PSLMST1) WITH_KEY(#DEPTMENT #SECTION)
NBR_KEYS(*COMPUTE) GENERIC(*YES)
FETCH FIELDS(#DEPTDESC) FROM_FILE(DEPTAB) WITH_KEY(#DEPTMENT) KEEP_LAST(1)
PRINT LINE(#DET01)
ENDSELECT
ENDPRINT
4. Save the code and then full function check or build the RDML
Make any corrections as required.
Exit the editor.
5. Compile the function. Be sure that the function is debug enabled.
6. Submit your new function using form iiiDEM19.
a. Enter a department of A and leave the section blank.
b. Check that the report headers and footers properly appear.