Inline Declarations in ABAP 7.40
Inline Declarations in ABAP 7.40
4
Dear SAPLearners,
DATA TYPE declarations is the first thing we do when we start ABAP coding. We declare the
variables at the start of the subroutine, method and report program etc.. Most of the
program lines we write are only for these data type declarations.
With ABAP 7.4 version, these data type declarations can be completely avoided. Whaat..?
No more DATA TYPE declaration ? then How my ABAP code works with out them ? Don’t
worry Inline Declarations will help and save you from those extra keyboard strokes for
DATA TYPE declarations.
ABAP 7.4
In this blog you will learn about Inline Declarations in ABAP 7.4. There are many new
features introduced in ABAP 7.4 and the ABAP stack is optimized for SAP HANA.
Inline Declarations
Now you can declare the variables and field-symbols at the same position where you are
using them. Inline declarations are possible only for DATA and FIELD-SYMBOL.
1. LEFT ASSIGNMENT
Old Syntax
lv_name = 'SAPLEARNERS.COM'.
New Syntax
DATA(lv_name) = 'SAPLEARNERS.COM'.
2. LOOP STATEMENT
Old Syntax
New Syntax
3. READ STATEMENT
Old Syntax
New Syntax
Old Syntax
SELECT matnr
ersda
ernam
laeda
aenam FROM mara
INTO TABLE lt_mara UP TO 10 ROWS.
New Syntax
SELECT matnr
ersda
ernam
laeda
aenam FROM mara
INTO TABLE @DATA(lt_mara) UP TO 10 ROWS.
So, now you know this new ABAP 7.4 feature, try and implement it next time you write any
ABAP code and let me know how you feel about it.
You can see list of installed software component versions like below