The Simple ABAP Report uses Internal tables and Work Areas

SAP ABAP report using internal tables and work areas, write statement in SAP ABAP

+ -

Getting data from a data base table and display data in the form of report using SAP ABAP.

In ABAP write statement is used to print output and : is chain statement ( Print multiple records ).

Display MARA data

DATA : IT_MARA TYPE TABLE OF MARA . "INTERNAL TABLE FOR MARA TABLE

DATA : WA_MARA TYPE MARA. "WORK AREA FOR MARA

SELECT * FROM MARA INTO TABLE IT_MARA. " GET MARA DATA
LOOP AT IT_MARA INTO WA_MARA.
WRITE :/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MEINS, WA_MARA-MBRSH. "Display required fields
ENDLOOP.

Display MARA data using user defined internal table

**TYPES is a statement which is used to declare a user defined internal table with specific fields
TYPES : BEGIN OF TY_MARA,
        MATNR TYPE MARA-MATNR,
        MTART TYPE MARA-MTART,
        MEINS TYPE MARA-MEINS,
        MBRSH TYPE MARA-MBRSH,
        END OF TY_MARA.
DATA : IT_MARA TYPE TABLE OF TY_MARA . "INTERNAL TABLE FOR ABOVE USER DEFINED TYPES TABLE

DATA : WA_MARA TYPE TY_MARA. "WORK AREA FOR ABOVE USER DEFINED TABLE

SELECT MATNR MTART MEINS MBRSH FROM MARA INTO TABLE IT_MARA. " GET MARA DATA
LOOP AT IT_MARA INTO WA_MARA.
  WRITE :/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MEINS, WA_MARA-MBRSH. "Display required fields
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 70 People out of 71 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →