Professional Documents
Culture Documents
Internal Table Expressions in ABAP 7.4 Release - SAP FREE Tutorials
Internal Table Expressions in ABAP 7.4 Release - SAP FREE Tutorials
07/02/2016
Hello everyone, in this blog you we are going to learn about Internal Table Expressions in ABAP 7.4
Release. This is second part in series of blog on What’s New in ABAP 7.4 Release.
Please read our rst blog on Inline Declarations for DATA and FIELD-SYMBOL. Lets get started.
READ TABLE
Before ABAP 7.4 we use READ TABLE syntax to read the internal table, but with new release of ABAP 7.4
SAP has introduced table expressions to read the internal table with brand new syntax.
We can read the internal table data with 3 possible ways.You will learn how to use table expressions to
read the internal table which is di erent from old syntax READ TABLE … .
1. READ INDEX – Read the internal table data using the table index
Old Syntax
New Syntax
DATA(WA_MARA) = IT_MARA[ 1 ].
2. READ USING a FREE KEY – Read the internal table using the free key.
Old Syntax
New Syntax
3. READ USING a TABLE KEY – Read the internal table by specifying table
keys
https://www.saplearners.com/internal-table-expression-in-abap-7-4-release/ 1/5
3/15/2020 Internal Table Expressions in ABAP 7.4 Release | SAP FREE Tutorials
Old Syntax
READ TABLE IT_BOOKINGS INTO WA_BOOKINGS WITH TABLE KEY CARRID = 'AA'
CONNID = '17'.
New Syntax
APPEND
Before Netweaver 7.4 we use APPEND syntax to append rows to the internal table, but with new
release of Netweaver 7.4 SAP has introduced table expressions to initialize the internal table with brand
new syntax.
Old Syntax
wa_old-f1 = 'A'.
APPEND wa_old TO it_old.
wa_old-f1 = 'B'.
APPEND wa_old TO it_old.
wa_old-f1 = 'C'.
APPEND wa_old TO it_old.
New Syntax
MODIFY
https://www.saplearners.com/internal-table-expression-in-abap-7-4-release/ 2/5
3/15/2020 Internal Table Expressions in ABAP 7.4 Release | SAP FREE Tutorials
We use MODIFY statement to modify the contents in internal table. In ABAP Netweaver 7.4 release SAP
has introduced brand new syntax using table expressions. We also use FIELD-SYMBOL to modify the
contents in internal table. We will look at both versions and you will also learn the new ABAP 7.4 new
syntax
Old Syntax
New Syntax
https://www.saplearners.com/internal-table-expression-in-abap-7-4-release/ 3/5
3/15/2020 Internal Table Expressions in ABAP 7.4 Release | SAP FREE Tutorials
CATCH cx_sy_itab_line_not_found.
ENDTRY.
#1. LINE_EXISTS( )
In ABAP 7.4, we have new syntax to check if the record exists in the internal table based on some
conditions. This syntax is short form to READ TABLE with TRANSPORTING NO FIELDS followed by sy-
subrc check. LINE_EXISTS function will return “true” if the row exists and “false” if the row does not
exists.
Old Syntax
.....
ENDIF.
New Syntax
#2. LINE_INDEX( )
In ABAP 7.4 release, we have new syntax LINE_INDEX() to identify the index of a row when a condition is
met while reading the internal table. The new syntax is similar to READ TABLE with TRANSPORTING
NO FIELDS followed by sy-subrc check. if sy-subrc = 0, then sy-tabix will give the index of the row.
Old Syntax
New Syntax
https://www.saplearners.com/internal-table-expression-in-abap-7-4-release/ 4/5
3/15/2020 Internal Table Expressions in ABAP 7.4 Release | SAP FREE Tutorials
Congrats! You have successfully learned new features in ABAP 7.4 release. Next time when you write
code try using the new syntax and let us know your experience. Please stay tuned for ABAP for
HANA/ABAP 7.4 tutorials. Leave a comment in the below comment section and let us know your
feedback.
Prakash
SAP Fiori Consultant
https://www.saplearners.com/internal-table-expression-in-abap-7-4-release/ 5/5