Select into corresponding fields

Using select into corresponding in sap abap, disadvantages of select into corresponding statement in SAP ABAP

+ -

Select into corresponding is used to get data from a database table into a user defined internal table or work area without specifying the list of fields.

Syntax: SELECT * FROM 
        INTO CORRESPONDING FIELDS OF TABLE  .
As per SAP standards select into corresponding statement is not advisable as it affects the performance of an application because it has to compare each field with database.

Example using select into corresponding

The below example explains how to use select into corresponding statement to get data into a database table with out specifying list of fields in select statement.

REPORT ZSAPN_SELECT_CORRESPONDING.
TYPES : BEGIN OF TY_MARA,
 "USER DEFINED TYPE WITH FOUR FIELDS
        MATNR TYPE MARA-MATNR,
        MTART TYPE MARA-MTART,
        MBRSH TYPE MARA-MBRSH,
        MEINS TYPE MARA-MEINS,
        END OF TY_MARA.
DATA : IT_MARA TYPE TABLE OF TY_MARA . "INTERNAL TABLE FOR USER DEFINED TYPE
DATA : WA_MARA TYPE TY_MARA . "WORK AREA FOR USER DEFINED TYPE
SELECT * FROM MARA
       INTO CORRESPONDING FIELDS OF TABLE IT_MARA
       UP TO 50 ROWS.
LOOP AT IT_MARA INTO WA_MARA.
WRITE :/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MBRSH, WA_MARA-MEINS.  "DISPLAY OUTPUT
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 60 People out of 66 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →