SAP NetWeaver AS ABAP Release 752, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Program Layout → Modularization Statements → Source Code Modules → Include Programs →
INCLUDE
Syntax
INCLUDE incl [IF FOUND].
Addition:
Effect
The statement INCLUDE includes the include program incl in this position in the source code. In syntax checks and when the program is generated by ABAP Compiler, the statement is replaced by the source code of the include program. The included INCLUDE program must consist of full statements.
If the specified include program does not exist, the syntax of the program is incorrect and cannot be executed. This error situation can be suppressed by specifying the addition IF FOUND.
Programming Guidelines
Notes
... IF FOUND
Effect
The addition IF FOUND dictates that the specified include program can be included only if it exists. If the include program does not exist, the INCLUDE statement is ignored and no syntax error occurs here.
Note
If the addition IF FOUND is specified, it is recommended that the including
program not be dependent on the source code of the include program. Otherwise, the include program may have correct syntax in systems where it exists but incorrect syntax in other systems.
Example
These lines show the master program of the function group ABAP_DOCU. This function group displays the keyword documentation on Application Server ABAP. It only contains INCLUDE statements that embed the actual source code. labap_docutop itself is made up of include programs for the individual declarations (global data and class declarations local to the program).