Ansicht
Dokumentation

ABAPINCLUDE_PROG - INCLUDE PROG

ABAPINCLUDE_PROG - INCLUDE PROG

CL_GUI_FRONTEND_SERVICES - Frontend Services   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

INCLUDE

Short Reference



INCLUDE incl $[IF FOUND$].

Addition:

... IF FOUND

Effect

The statement INCLUDE includes the include program incl at this position in the source code. In syntax checks and the generation of the program by the 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 program is syntactically incorrect and cannot be executed. This error situation can be suppressed by specifying the addition IF FOUND.

Notes

  • The statement INCLUDE is the only statement that can be used at the first position of a program instead of a statement that introduces a program. The requirement for this is that, after the include program is resolved, a statement that introduces a program is positioned at the start of the including program.
  • ABAP Workbench supports the automatic creation of include programs for specific program parts, such as the top include for global declarative statements. It is recommended that the naming conventions proposed by the ABAP Workbench are always used. The top include can contain only declarative statements and is respected when individual include programs of a program are compiled.
  • In the Repository Browser of the Object Navigator of the ABAP Workbench, the INCLUDE programs included by a program are listed as its subnodes.

Addition

... IF FOUND

Effect

The addition IF FOUND specifies that the specified include program is only included if it exists. If the include program does not exist, the INCLUDE statement is ignored and no syntax error occurs at this position.

Note

If the addition IF FOUND is specified, the including program should not be dependent on the source code of the include program. Otherwise, the include program may be syntactically correct in systems where it exists but incorrect in other systems.

Example

These lines show the master program of the function pool ABAP_DOCU, which represents the ABAP Keyword Documentation in SAP GUI. It only contains INCLUDE statements that include the actual source code, where labap_docutop itself is made up of include programs for the individual declarations (global data and class declarations local to the program).

*&----------------------------------------------------------------*
*&  Function Pool SAPLABAP_DOCU
*&----------------------------------------------------------------*

  INCLUDE labap_docutop.               " Global Declarations

  INCLUDE labap_docue00.               " Load of Program

  INCLUDE labap_docuuxx.               " Function Modules

  INCLUDE labap_docuo01.               " PBO Modules

  INCLUDE labap_docui01.               " PAI Modules

  INCLUDE labap_docue01.               " Handling of Runtime-Events

  INCLUDE labap_docup01.               " Class implementations
  INCLUDE labap_docup02.
  INCLUDE labap_docup03.
  INCLUDE labap_docup04.

  INCLUDE labap_docut99.               " Unit tests






CL_GUI_FRONTEND_SERVICES - Frontend Services   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 5643 Date: 20240328 Time: 212253     sap01-206 ( 78 ms )