ABAP Include Program

Include programs are not standalone programs and cannot be executed independently. They can be used as a container for ABAP source code. They are used to organize the ABAP source code into small editable units which can be inserted at any place in other ABAP programs using the INCLUDE statement. Include programs can be used in different programs. The include statement copies the contents of the include program into the main program.

Include programs have no parameter interface and they cannot call themselves.

While creating the INCLUDE program using the ABAP editor choose program type as "I" i.e. INCLUDE program in the program attributes.

abap-include-1

Syntax for Include program is as follows.

INCLUDE <Include Program Name>

Source code of ZINCLUDE_DATA.

DATA: g_name(10) TYPE c.

Source code of ZINCLUDE_WRITE.

WRITE:/ 'Inside include program'.

Source code of main program.

REPORT  zmain_program.

INCLUDE zinclude_data.

WRITE:/ 'Main Program'.

INCLUDE zinclude_write.

Output

abap-include-2


Leave a Reply

Your email address will not be published. Required fields are marked *