i_vbkok-vbeln_vl = w_sd130-vbeln_vl_prn . "<- Delivery number
i_vbkok-wabuc = 'X'. " <- Automatic PGI
i_vbkok-wadat_ist = w_sd130-wadat_ist .
append i_vbkok.
loop at it_sd130 .
i_vbpok_tab-vbeln_vl = it_sd130-vbeln_vl_prn .
i_vbpok_tab-posnr_vl = it_sd130-posnr_vl_prn .
if it_sd130-posnn_vl_prn >'900000'.
i_vbpok_tab-VBELN_VL = it_sd130-vbeln_vl_prn .
i_vbpok_tab-POSNR_VL = it_sd130-posnn_vl_prn .
i_vbpok_tab-LIPS_DEL = 'X' .
endif .
collect i_vbpok_tab into i_vbpok_tab .
endloop .
call function 'WS_DELIVERY_UPDATE'
exporting
vbkok_wa = i_vbkok
commit = 'X'
delivery = w_sd130-vbeln_vl_prn
update_picking = 'X'
tables
vbpok_tab = i_vbpok_tab
prot = i_prott
exceptions
error_message = 1
others = 2.