Introduction to Inline Declarations ABAP 7.4


What are inline declarations in ABAP 7.4 ? Introduction to inline declarations in ABAP 7.4

A+ A-

One of the most useful concept introduced in SAP NetWeaver 7.4 is ABAP inline declarations, this will help an ABAP Developer to simplify programming help to reduce unnecessary data declarations in a program.

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.

Below is the example of declaring a plain variable to store some string.

Using ABAP before ABAP 7.4

DATA: LV_TEXT TYPE STRING.
LV_TEXT = 'This is declaration before 7.4'.

Below is the example After ABAP 7.4, you need to use DATA keyword with open and close brackets '(' to declare variable. 

DATA(LV_TEXT) = 'This is Declaration for 7.4'.

Using Workarea inline in ABAP 7.4

Before ABAp 7.4

DATA: WA_MARA TYPE MARA.

SELECT SINGLE *
  FROM MARA
  INTO WA_MARA WHERE MATNR = '0001'.

WRITE:/ wa_mara-matnr, wa_mara-mtart.

After ABAP 7.4, you need to use @ symbol for using variables in ABAP 7.4 Open SQL statements

SELECT SINGLE * FROM MARA
  INTO @DATA(wa_MARA) WHERE MATNR = '0001'.

WRITE:/ wa_mara-matnr, wa_mara-mtart.


Learner Questions

No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question


    Was this lesson helpful to you? Yes No 2 People out of 2 think this lesson helpful

    Lesson Navigation

    ←Previous Chapter
    Next Lesson → ABAP 7.4 Select Statements OPEN SQL