Hello
i am new in ABAP developement. I have some problem with regrading code .
PARAMETERS : P_EBELN TYPE EBELN.
TYPES : BEGIN OF TY_RSEG,
MATNR TYPE RSEG-MATNR,
TXZ01 TYPE EKPO-TXZ01,
IDLNF TYPE EKPO-IDNLF,
BPMNG TYPE RSEG-BPMNG,
END OF TY_RSEG.
DATA IT_EKKO TYPE TABLE OF EKPO.
DATA WA_EKKO TYPE EKPO.
DATA I_RSEG TYPE TABLE OF RSEG.
DATA W_RSEG TYPE RSEG.
DATA IT_RSEG TYPE TABLE OF TY_RSEG .
DATA WA_RSEG TYPE TY_RSEG.
FIELD-SYMBOLS <FS_S> TYPE TY_RSEG.
SELECT * FROM EKPO INTO TABLE IT_EKKO
WHERE EBELN = P_EBELN.
LOOP AT IT_EKKO INTO WA_EKKO.
WA_RSEG-TXZ01 = WA_EKKO-TXZ01.
WA_RSEG-IDLNF = WA_EKKO-IDNLF.
APPEND WA_RSEG TO IT_RSEG.
ENDLOOP.
SELECT * FROM RSEG INTO TABLE I_RSEG
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN = IT_EKKO-EBELN
AND EBELP = IT_EKKO-EBELP.
LOOP AT I_RSEG INTO W_RSEG.
WA_RSEG-MATNR = W_RSEG-MATNR.
WA_RSEG-BPMNG = W_RSEG-BPMNG.
APPEND WA_RSEG TO IT_RSEG.
ENDLOOP.
LOOP AT IT_RSEG ASSIGNING <FS_S>.
WRITE: / <FS_S>-MATNR,
<FS_S>-TXZ01,
<FS_S>-IDLNF,
<FS_s>-BPMNG.
ENDLOOP.