Basics For Inline Declarations With Sap-Abap Author: Pradyut S. Vyas Mentored By: Pranesh Kumar
Basics For Inline Declarations With Sap-Abap Author: Pradyut S. Vyas Mentored By: Pranesh Kumar
Inline declarations are most useful in reducing onetime and local data declarations in a ABAP Object,
for example If you want to store some value inside in a Function Module/Perform and you don`t
need to access them globally, you can declare a inline variable and use it locally.
For further clarity on this topic, I created a reference program locally parallel to this documentation
and tried to put up as much as I can of the recent learnings on this topic, feel free to refer at the
same:
Server: D90; Client: 551(ABAP Client) / 570(Test Client); Program Name: ZINLDECL_TRY1.
To start with, writing a basic report with a selection screen and a select query to fetch data based on
user input and noting the observation for the same, that ways we can see how to declare an
internal table in the program.
Further, if we are required to dump data from one internal table to another for some operation an
internal table can be declared by simply using the declaration operator “DATA”.
Moving forward, similarly we can use the “DATA” declaration operator for further declaring a work
area as well as variables, below shown code are several examples for the same:
Further for declaring a field symbol, SAP has provided a new declaration operator FIELD-
SYMBOL(…).