SAP READ TABLE TRANSPORT OPTIONS ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• COMPARING READ TABLE itab
• ALL FIELDS READ TABLE itab
• NO FIELDS READ TABLE itab
• TRANSPORTING READ TABLE itab

READ TABLE, transport_options
Short Reference

ABAP_SYNTAX
... $[COMPARING ${ ${ comp1 comp2 ...$}$|${ALL FIELDS$}$|${NO FIELDS$} $}$]
$[TRANSPORTING ${ ${comp1 comp2 ... $}$|${ALL FIELDS$} $}$] ...

What does it do?
The addition COMPARING compares the specified components comp1 comp2 ... or their subareas or attributes in a found line before they are transported with the corresponding components of the work area. If ALL FIELDS is specified, all components are compared. If no NO FIELDS is specified, no components are compared. If the content of the compared components is identical, sy-subrc is set to 0 and otherwise to 2. The line found is assigned to the work area independently of the result of the comparison.
If the addition TRANSPORTING is specified, only the specified components comp1 comp2 ... or their subareas in the found line are assigned to the corresponding components of the work area or its subareas. If ALL FIELDS is specified, all components are assigned.
COMPARING must be specified in front of TRANSPORTING. The components comp1 comp2 ... are specified according to the rules in the section Specifying Components, with the restriction that after TRANSPORTING, no attributes of classes can be addressed using the object component selector.

ABAP_EXAMPLE_VX5
The READ statement uses a WHILE loop to read all lines of the table sflight_tab one after the other using the primary table index in the work area sflight_wa. Only fields that are also in the output are transported. The COMPARING addition is used to select all flights in which no seats have yet been booked.
ABEXA 00541
ABAP_EXAMPLE_END

Return to menu