AIM: Simple program to write standard table KNA1 content into screen.
REPORT zkan1_pro1.
TABLES: KNA1.
TYPES: BEGIN OF STR,
KUNNR TYPE KNA1-KUNNR,
LAND1 TYPE KNA1-LAND1,
NAME1 TYPE KNA1-NAME1,
NAME2 TYPE KNA1-NAME2,
ORT01 TYPE KNA1-ORT01,
END OF STR.
DATA: ITAB TYPE STANDARD TABLE OF STR, "ITAB is an internal table
WA TYPE STR. "WA is an work area
SELECT KUNNR
LAND1
NAME1
NAME2
ORT01
FROM KNA1
INTO TABLE ITAB.
LOOP AT ITAB INTO WA.
WRITE:/ WA-KUNNR,
WA-LAND1,
WA-NAME1,
WA-NAME2.
ENDLOOP.
REPORT zkan1_pro1.
TABLES: KNA1.
TYPES: BEGIN OF STR,
KUNNR TYPE KNA1-KUNNR,
LAND1 TYPE KNA1-LAND1,
NAME1 TYPE KNA1-NAME1,
NAME2 TYPE KNA1-NAME2,
ORT01 TYPE KNA1-ORT01,
END OF STR.
DATA: ITAB TYPE STANDARD TABLE OF STR, "ITAB is an internal table
WA TYPE STR. "WA is an work area
SELECT KUNNR
LAND1
NAME1
NAME2
ORT01
FROM KNA1
INTO TABLE ITAB.
LOOP AT ITAB INTO WA.
WRITE:/ WA-KUNNR,
WA-LAND1,
WA-NAME1,
WA-NAME2.
ENDLOOP.