SAP GLOBAL DECLAR - Guide
Get Example source ABAP code based on a different SAP table
Global Declarations of a Program
ABAP_BACKGROUND
Each ABAP program has a global declaration part where data types, interfaces, classes, and data objects that are visible throughout the program can be declared.
From a technical viewpoint, the global declaration part consists of all declarations that cannot be assigned to a more local context (class, procedure). All declarations implemented in processing blocks without their own contexts (in event blocks and dialog modules) and declarations declared between completed processing blocks are assigned to the global context. Event blocks of
In an ABAP statement, it is only ever possible to refer to the previous declarations of the currently visible contexts.
ABAP_RULE
Place the global declaration part of a program at a central, context-related point at the beginning of the program.
ABAP_DETAILS
The global declaration part should only ever be the area between the program-initiating statement and the first implementation. This the only place where global declarations should be made in a meaningful order. This ensures that the declarations intended for global use can really be used in all subsequent implementations.
There should not be any declarative statements in contexts that do not support local data (provided that they are
This rule is only of explicit relevance when working with program types other than class or interface pools. Class Builder implicitly specifies which declarations occur and where. These are the declarations of the global class or global interface itself as well as optional local data types, classes, and interfaces in
For other