DATA: gt_alv TYPE TABLE OF ty_data,
wa_alv TYPE ty_data.
DATA: ls_alv TYPE ty_data.
ls_alv = wa_data.
CLEAR: wa_data,wa_alv.
"抬头内表数据读到工作区
READ TABLE gt_alv INTO wa_alv WITH KEY sel = 'X'.
ls_alv = wa_alv.
LOOP AT gt_alv1 INTO wa_alv1 WHERE ebeln = ls_alv-ebeln.
* READ TABLE gt_alv1 INTO wa_alv1 WITH KEY sel = 'X'.
MOVE-CORRESPONDING wa_alv1 TO wa_item.
wa_item-werks = wa_alv1-werks.
wa_item-matnr = wa_alv1-matnr.
wa_item-menge = wa_alv1-menge.
wa_item-meins = wa_alv1-meins.
wa_item-lgort = wa_alv1-lgort.
APPEND wa_item TO gt_item.
CLEAR:wa_item,wa_alv1.
ENDLOOP.