A real life example for using a temporary program
REPORT CHAP2503.* Variables for later usePARAMETERS TABNAME(10) DEFAULT ‘CUSTOMERS’.DATA: SOURCE_TABLE(72) OCCURS 100 WITH HEADER LINE,PROGRAM_NAME LIKE SY-CPROG,SYNTAX_CHECK_MESSAGE(128),LINE_NO TYPE I.* Building the source code PERFORM BUILD_THE_SOURCE_CODE USING TABNAME.* Generating the temporary program, checking syntax errorsGENERATE SUBROUTINE POOL SOURCE_TABLENAME PROGRAM_NAMEMESSAGE SYNTAX_CHECK_MESSAGELINE LINE_NO.IF SY-SUBRC NE 0.WRITE: / ‘Syntax error, message’, SYNTAX_CHECK_MESSAGE,/ ‘in line’, LINE_NO.EXIT.ENDIF.* Calling a form externallyPERFORM … Read more