REPORT XXXXXXXX
LINE-SIZE XX
LINE-COUNT XX
MESSAGE-ID XX
NO STANDARD PAGE HEADING.
****************** Report Source
code documentation ********************
* Program : $Program
Code
* Title
: $Program Title
* Description : $Program name
* Assumption : $program_assu1
*
$program_assu2
* User Inputs
* Parameters : $param1
*
$param2
*
$param3
*
* Ranges : $ranges
*
$ranges
*
************************************************************************
* Common source code module for the application area
*include $zmodappl.
* Source code module specific to the report
*include $zmodrept
* Declaration module
* include $zmoddecl
TABLES: $T1
* Structures to keep constituents
for UDI(having constituents)
DATA: BEGIN OF $UDI,
END OF $UDI.
* Structure to keep Entities of the business cycle related to the report
DATA: BEGIN OF CYCLE_ENTITIES occurs 25,
&ENT1
&ENT2
END OF CYCLE_ENTITIES.
* Array to keep Master data
DATA: BEGIN OF MASTER OCCURS 100,
END OF MASTER.
* Array to keep Detail data
DATA: BEGIN OF DETAIL OCCURS 100,
END OF DETAIL.
* Array to keep Total data
DATA: BEGIN OF SUMMARY OCCURS 100,
END OF SUMMARY.
* Array to keep Grand Total data(Report Total Data)
DATA: BEGIN OF G_SUMMARY OCCURS 100,
END OF G_SUMMARY.
* Input screen module keeping Input screen fields
SELECT-OPTIONS:
* Fields of Master data
* Fields of Detail data
* Fields of Total data
* Start-of-processing
START-OF-SELECTION.
*MODULE TO PRODUCE
MASTER DATA OF THE REPORT
* Initialize MASTER data array data-items
CLEAR MASTER.
* Select MASTER dataS related to Base Entity(&Ent1)
* Select keys of the Entity(&Ent2) of the workflow
* cycle related to &Ent1
* Select MASTER data of the Second entity of the workflow cycle &Ent2
* fill VALUES IN MASTER data array
MASTER-FIELD1 = &ENT1-FIELD1
MASTER-FIELD2 = &ENT2-FIELD2
....
*MODULE TO
PRODUCE DETAIL DATA OF THE REPORT
* Initialize DETAIL data array data-items
CLEAR DETAIL.
* Select DETAIL data related to &Ent1
* Select DETAIL data related to &Ent2
* Fill data in DETAIL data array
DETAIL-FIELD1 = &ENT1-FIELD1
DETAIL-FIELD2 = &ENT2-FIELD2
......
APPEND DETAIL.
* Initialize DETAIL data array data-items
CLEAR DETAIL.
ENDSELECT.
* fill data in master data array
READ TABLE DETAIL WITH KEY $CONNECTING-FIELD1 = MASTER-FIELD1
$CONNECTING-FIELD2 = MASTER-FIELD2.
IF SY-SUBRC = 0.
"if detail data is present
APPEND MASTER.
ENDIF.
* INITIALIZE MASTER DATA ARRAY
CLEAR MASTER.
ENDSELECT.
* MODULE TO
PRODUCE SUMMARY DATA OF THE REPORT
* Initialize SUMMARY data array data-items
CLEAR SUMMARY.
* Module to produce summary of DETAIL
* Fill data in SUMMARY data array
SUMMARY-FIELD1 = &DETAIL-FIELD1
SUMMARY-FIELD2 = &DETAIL-FIELD2
......
APPEND SUMMARY.
* INITIALIZE SUMMARY DATA ARRAY
CLEAR SUMMARY.
ENDLOOP.
* MODULE
TO PRODUCE SUMMARY DATA OF THE REPORT
* Initialize SUMMARY data array data-items
CLEAR G_SUMMARY.
* Module to produce summary of Detail
* Fill data in SUMMARY data array
APPEND G_SUMMARY.
CLEAR G_SUMMARY.
*endloop.
End-of-selection.
* End of selection
PERFORM ROUTE_OUTPUT_OF_THE_PROCESS.
TOP-OF-PAGE.
PERFORM PO_PAGE_HEADER.
END-OF-PAGE.
PERFORM PO_PAGE_FOOTER.
*
END OF THE REPORT
* function activity_documentation('Routing of Report')
FORM ROUTE_OUTPUT_OF_THE_PROCESS.
SORT MASTER BY $FIELD1 $FIELD2.
SORT DETAIL BY $FIELD1 $FIELD2.
* print header information group(header of the report)
* print master information group
* print ig head(print udi templates)
* print ig body
LOOP AT MASTER.
ON CHANGE OF $MASTER-FIELD1.
NEW-PAGE.
ENDON.
* WRITE MASTER RECORD.
* print detail information group
*print ig documentation
*print ig head(print field templates)
*print ig body (use connecting fields between structs of same entity)
LOOP AT DETAIL WHERE $FIELD1 = $MASTER-CONNECTING_FIELD1
AND $FIELD2 = $MASTER-CONNECTING_FIELD2.
* WRITE DETAIL RECORD
ENDLOOP.
LOOP AT SUMMARY
* print total information group
* print ig documentation
* print ig head(print field templates)
* print ig body('Domain of Detail-3')(use connecting fields between
igs)
* print ig foot
ENDLOOP.
CLEAR MASTER.
CLEAR DETAIL.
* MODULE TO PRODUCE FOOTER DATA OF THE REPORT
* function footer_of_the_report('FooterF')
* PRINT FOOTER OF THE REPORT
ENDLOOP.
LOOP AT G_SUMMARY.
ENDLOOP.
ENDFORM.
FORM PO_PAGE_HEADER.
ENDFORM.
FORM PO_PAGE_FOOTER.
ENDFORM.
If you have comments or suggestions, email us at gssoft@goplay.com
Copyright ©, 1998, GS Software, Last modified Jan 1,1998