首页 > SAP > ABAP > Internal Table Expressions in NetWeaver 7.4 Release
2019
08-29

Internal Table Expressions in NetWeaver 7.4 Release

Before Netweaver 7.4 we use READ TABLE syntax to read the internal table, but with new release of Netweaver 7.4 SAP has introduced table expressions to read the internal table with brand new syntax.

We can read the internal table data with three possible ways.You will learn how to use table expressions to read the internal table which is different from old syntax READ TABLE … .

1. Index read – We can read the internal table data using the table index

.Old Syntax
.New Syntax

2. Read using a free key – We can read the internal table using the free key.

.Old Syntax
.New Syntax

3. Read using a table key – We can read the internal table by specifying the table keys

.Old Syntax
. New Syntax

6.1.2APPEND

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
. New Syntax

6.1.3MODIFY

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

6.1.4New Predicate Function – 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
.New Syntax

6.1.5New Table Function – 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

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.