SELECT user-defined FIELD names ABAP 7.4


Working with user-defined fields in ABAP Select statements using AS keyword ABAP 7.4

A+ A-

In NetWeaver 7.4, you can use user-defined field names in OPEN SQL select statements by using keyword AS

Below is the example SELECT query to get MATNR and MTART into user-defined field names MATERIAL and MATERIAL_TYPE respectfully.

Syntax: SELECT <COLUMN1> AS <USERDEFIND_COL1>, <COLUMN2> AS <USERDEFIND_COL2> .... 

INTO <ITAB> FROM <DATABASETABLE>.

Example using User-defined fields in SELECT statement ABAP 7.4


SELECT  MATNR as MATERIAL, MTART as MATERIAL_TYPE
  FROM MARA
  INTO TABLE @DATA(IT_MARA)
  WHERE MTART = 'FERT'.
  
  LOOP AT it_MARA INTO DATA(WA_MARA).
  WRITE:/ wa_mara-MATERIAL, wa_mara-MATERIAL_TYPE.
  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 5 People out of 5 think this lesson helpful

    Lesson Navigation

    ←Previous Chapter
    Next Lesson → Internal Table Operations with ABAP 7.4