Fetching the data records of single table using single parameter entry in the selection screen
TABLES: EKKO.
TYPES: BEGIN OF TY_EKKO,
EBELN TYPE EKKO-EBELN,
LIFNR TYPE EKKO-LIFNR,
BUKRS TYPE EKKO-BUKRS,
END OF TY_EKKO.
DATA: IT_EKKO TYPE TABLE OF TY_EKKO,
WA_EKKO TYPE TY_EKKO.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: P_EBELN TYPE EKKO-EBELN.
SELECTION-SCREEN: END OF BLOCK B1.
START-OF-SELECTION.
SELECT EBELN
LIFNR
BUKRS
FROM MARA
INTO TABLE IT_EKKO
WHERE EBELN EQ P_EBELN.
IF SY-SUBRC EQ 0.
LOOP AT IT_EKKO INOT WA_EKKO.
WRITE:/ WA_EKKO-EBELN, WA_EKKO-LIFNR, WA_EKKO-BUKRS.
ENDLOOP.
ENDIF.
No comments:
Post a Comment