Dynamic program generation

The ABAP language also allows the creation of ABAP programs at runtime. An INSERT REPORT statement may be used for creating a new program specified by the a name in the statement. Dynamic program generation should only be used when there is no alternate option.

Also, you may generate a subroutine pool using a GENERATE subroutine pool statement. A subroutine pool is generated, and is of a temporary nature. The subroutines in the pool may be called from within the generation program.

On the other hand, the programs created via the INSERT REPORT statement are permanent and overwrite any prior existing programs with the same name. Within the generation program, the new program may be called via a SUBMIT statement.

Getting ready ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.