Ansicht
Dokumentation
ABENDATA_IN_EVENTS - DATA IN EVENTS
CPI1466 during Backup BAL_S_LOG - Application Log: Log header dataThis documentation is copyright by SAP AG.
Data Declarations in Events
With "DATA X" in an event: When is X local, when is it global?
When you declare data
(for example, using DATA), it depends on where in the program you define it as to whether it
is global (can be addressed anywhere in the program), or whether the scope is restricted to the event in which you have placed it (local). Whilst it is clear that DATA
X between FORM andENDFORM
or FUNCTION and ENDFUNCTION
defines a variable X that is only recognized within the routine, the handling of this issue is
not so clear with events. In this case, it depends whether the event is implemented internally as a FORM routine or not.
Global:
Local:
Example
Global data definition:
INITIALIZATION.
DATA X.
START-OF-SELECTION.
MOVE 'A' TO X.
is syntactically correct.
Example
Local data definition:
AT SELECTION-SCREEN.
DATA X.
START-OF-SELECTION.
MOVE 'A' TO X.
results in a syntax error because the field X is known only in connection with the event "AT SELECTION-SCREEN".
ROGBILLS - Synchronize billing plans Addresses (Business Address Services)
This documentation is copyright by SAP AG.
Length: 2554 Date: 20240427 Time: 055208 sap01-206 ( 39 ms )