0% found this document useful (0 votes)
1K views4 pages

Inline Declarations in ABAP 7.40

This document discusses inline declarations, a new feature introduced in ABAP 7.4 that allows variables and field symbols to be declared at the point of use rather than separately at the start of a program. It provides examples of how the syntax for left assignment, loop statements, read statements, and select statements is updated to support inline declarations. Inline declarations can help reduce the number of lines needed for traditional data type declarations at the start of programs. The document encourages readers to try using inline declarations and share their experiences. It also provides instructions for determining if a system is running on ABAP 7.4 by checking the product version in the system status screen.

Uploaded by

Emil S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views4 pages

Inline Declarations in ABAP 7.40

This document discusses inline declarations, a new feature introduced in ABAP 7.4 that allows variables and field symbols to be declared at the point of use rather than separately at the start of a program. It provides examples of how the syntax for left assignment, loop statements, read statements, and select statements is updated to support inline declarations. Inline declarations can help reduce the number of lines needed for traditional data type declarations at the start of programs. The document encourages readers to try using inline declarations and share their experiences. It also provides instructions for determining if a system is running on ABAP 7.4 by checking the product version in the system status screen.

Uploaded by

Emil S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Inline Declarations in ABAP 7.

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

DATA lv_name TYPE string.

lv_name = 'SAPLEARNERS.COM'.
New Syntax

DATA(lv_name) = 'SAPLEARNERS.COM'.

2. LOOP STATEMENT

Old Syntax

DATA: lw_mara TYPE ty_mara,

LOOP AT lt_mara INTO lw_mara.


WRITE: lw_mara-matnr,lw_mara-ernam. ....
ENDLOOP.

New Syntax

LOOP AT lt_mara INTO DATA(lw_mara).


WRITE: lw_mara-matnr,lw_mara-ernam. ....
ENDLOOP.

3. READ STATEMENT

Old Syntax

DATA: lw_mara TYPE ty_mara.

READ TABLE lt_mara INTO lw_mara INDEX 1.

New Syntax

READ TABLE lt_mara INTO DATA(lw_mara) INDEX 1.


 4. SELECT STATEMENT

Old Syntax

TYPES: BEGIN OF ty_mara,


matnr TYPE matnr,
ersda TYPE ersda,
ernam TYPE ernam,
laeda TYPE laeda,
aenam TYPE aenam,
END OF ty_mara.

DATA: lt_mara TYPE STANDARD TABLE OF ty_mara.

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.

Also Read: LET keyword in ABAP 7.4

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.

Are you working on SAP ABAP 7.4?


To answer this question, log on to your SAP system.
 In the menu bar navigate to System → Status.
 In the popup window, under SAP system data section click on display button under
“Product Version” field.

You can see list of installed software component versions like below

From list of installed software components, look for the Release version


of SAP_BASIS and SAP_ABA components to check the SAP Netweaver version.

You might also like