You are on page 1of 1

//internal table CODE DATA CODE(72) OCCURS 10. APPEND 'REPORT ZDYN1.' TO CODE.

APPEND 'WRITE / ''Hello, I am dynamically created!''.' TO CODE. // transfer the new module, which in the above example is an executable program (report), into the program library INSERT REPORT 'ZDYN1' FROM CODE. --------------------------------------------------------------------------//the following simple report: REPORT ZDYN3. WRITE / 'Dynamic Program!'. //The following executable program (report) starts, modifies, and restarts ZDYN3: REPORT ZMASTER1. DATA CODE(72) OCCURS 10. DATA LIN TYPE I. READ REPORT 'ZDYN3' INTO CODE. SUBMIT ZDYN3 AND RETURN. DESCRIBE TABLE CODE LINES LIN. MODIFY CODE INDEX LIN FROM 'WRITE / ''Dynamic Program Changed!''.'. INSERT REPORT 'ZDYN3' FROM CODE. SUBMIT ZDYN3. //OUTPUT The output of this program is displayed on two subsequent output screens. The first screen displays: Dynamic Program! The second screen displays: Dynamic Program Changed! When you use the SUBMIT statement, all modifications made to a program during runtime take immediate effect before they are submitted. In the above example, ZDYN3 is submitted from ZMASTER1 first in its original and then in its modified form, generating different results.

You might also like