Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Performance issue

I have some performance issue. I wanted to remove below loops.

Actually WA_DELIVERY_MASTER is my output table. i do want to append values into it.

  • Merging all the delivery related data

LOOP AT li_delivery INTO lwa_delivery.

wa_delivery_master-vbeln = lwa_delivery-vbeln.

wa_delivery_master-ernam = lwa_delivery-ernam.

wa_delivery_master-erdat = lwa_delivery-erdat.

wa_delivery_master-lifsk = lwa_delivery-lifsk.

wa_delivery_master-lfdat = lwa_delivery-lfdat.

wa_delivery_master-lddat = lwa_delivery-lddat.

wa_delivery_master-wadat = lwa_delivery-wadat.

wa_delivery_master-tddat = lwa_delivery-tddat.

wa_delivery_master-route = lwa_delivery-route.

wa_delivery_master-wadat_ist = lwa_delivery-wadat_ist.

wa_delivery_master-vgbel = lwa_delivery-vgbel.

wa_delivery_master-vgpos = lwa_delivery-vgpos.

wa_delivery_master-posnr = lwa_delivery-posnr.

wa_delivery_master-lfimg = lwa_delivery-lfimg.

wa_delivery_master-mbdat = lwa_delivery-mbdat.

wa_delivery_master-kostk = lwa_delivery-kostk.

wa_delivery_master-wbstk = lwa_delivery-wbstk.

wa_delivery_master-pkstk = lwa_delivery-pkstk.

lv_count = 0.

  • Merging Shipment data

LOOP AT li_shipment INTO lwa_shipment

WHERE vbeln = lwa_delivery-vbeln.

wa_delivery_master-tknum = lwa_shipment-tknum.

wa_delivery_master-ernam_vttk = lwa_shipment-ernam.

wa_delivery_master-sttrg = lwa_shipment-sttrg.

wa_delivery_master-vsart = lwa_shipment-vsart.

wa_delivery_master-vsart_desc = lwa_shipment-vsart_desc.

wa_delivery_master-tplst = lwa_shipment-tplst.

wa_delivery_master-tdlnr = lwa_shipment-tdlnr.

wa_delivery_master-dalbg = lwa_shipment-dalbg.

wa_delivery_master-dalen = lwa_shipment-dalen.

wa_delivery_master-datbg = lwa_shipment-datbg.

wa_delivery_master-stlad = lwa_shipment-stlad.

wa_delivery_master-tpnum = lwa_shipment-tpnum.

APPEND wa_delivery_master TO gi_delivery_master.

lv_count = 1.


IF lv_count NE 1.

APPEND wa_delivery_master TO gi_delivery_master.


CLEAR wa_delivery_master.


I do not want to use 2 loops. It is affecting my performance.

Former Member
Not what you were looking for? View more on this topic or Ask a question