Select using internal table inline declaration ABAP 7.4


Using internal table inline declaration in OPEN SQL select with ABAP 7.4

A+ A-

Below is the example of using internal table inline declaration in OPEN SQL select statements using ABAP 7.4, in the below example we use OPEN SQL statements to read multiple records from database table.

Select Statement before ABAP 7.4

DATA : IT_MARA TYPE TABLE OF MARA,
       WA_MARA TYPE MARA.

SELECT *
  FROM MARA
  INTO TABLE IT_MARA
  WHERE MTART = 'FERT'.

  LOOP AT it_MARA INTO WA_MARA.
   WRITE:/ wa_mara-MATNR, wa_Mara-mtart, wa_mara-meins.
  ENDLOOP.

Select Statement after ABAP 7.4, using inline declaration

SELECT *
  FROM MARA
  INTO TABLE @DATA(IT_MARA)
  WHERE MTART = 'FERT'.

  LOOP AT it_MARA INTO DATA(WA_MARA).
   WRITE:/ wa_mara-MATNR, wa_Mara-mtart, wa_mara-meins.
  ENDLOOP.

Using Select fields list ABAP 7.4

SELECT MATNR, MTART, MEINS
  FROM MARA
  INTO TABLE @DATA(IT_MARA)
  WHERE MTART = 'FERT'.

LOOP AT it_MARA INTO DATA(WA_MARA).
  WRITE:/ wa_mara-MATNR, wa_Mara-mtart, wa_mara-meins.
ENDLOOP.

Learner Questions

No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question


    Was this lesson helpful to you? Yes No 2 People out of 2 think this lesson helpful

    Lesson Navigation

    ←Previous Chapter
    Next Chapter →