append lines of it_pkld to it_pkld2.
提取每一行数据到 it_pkld2
REPORT ZBAP02.
data: gs_flight type sflight,
gs_flight2 type standard table of sflight.
select single * from sflight into gs_flight where carrid = 'AA'.
append gs_flight to gs_flight2.
select single * from sflight into gs_flight where carrid = 'AA'.
append gs_flight to gs_flight2.
select single * from sflight into gs_flight where carrid = 'AZ'.
append gs_flight to gs_flight2.
write :/ '-----', gs_flight-carrid.
loop at gs_flight2 into gs_flight.
write :/ 'gs_flight2-->',gs_flight-carrid.
endloop.
loop at p_aufnr.
select * from zces_pack05_d
into corresponding fields of table it_pkld
where werks = p_werks and docnr = p_aufnr-low and delet = ''
order by werks docnr matnr charg .
append lines of it_pkld to it_pkld2.
endloop.
* default input qty
it_pkld[] = it_pkld2[].
loop at it_pkld.
it_pkld-inqty = it_pkld-bdmng - it_pkld-enmng.
参考
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenappend_lines_abexa.htm