Code: Alles auswählen.
ls_headerdata-shipment_num = lv_tknum.
ls_hdunheader-hdl_unit = i_venum_out.
ls_hdunheader-hdl_unit_exid = lv_exidv.
APPEND ls_hdunheader TO lt_hdunheader.
ls_hdunheaderaction-hdl_unit = 'C'.
ls_hdunheaderaction-hdl_unit_exid = 'C'.
APPEND ls_hdunheaderaction TO lt_hdunheaderaction.
ls_hdunitem-hdl_unit_into = i_venum_out.
ls_hdunitem-hdl_unit_no = i_venum_out.
ls_hdunitem-hdl_unit_exid_into = lv_exidv.
ls_hdunitem-hdl_unit_exid = lv_exidv.
ls_hdunitem-deliv_numb = i_vepo_von-vbeln.
ls_hdunitem-deliv_item = i_vepo_von-posnr.
ls_hdunitem-pack_qty = i_vepo_von-vemng.
ls_hdunitem-sales_unit = i_vepo_von-vemeh.
ls_hdunitem-sales_unit_iso = i_vepo_von-vemeh.
ls_hdunitem-material = i_vepo_von-matnr.
ls_hdunitem-pack_qty_base = i_vepo_von-vemng.
ls_hdunitem-base_uom = i_vepo_von-vemeh.
ls_hdunitem-base_uom_iso = i_vepo_von-vemeh.
APPEND ls_hdunitem TO lt_hdunitem.
ls_hdunitemaction-hdl_unit_into = 'D'.
ls_hdunitemaction-hdl_unit_no = 'D'.
ls_hdunitemaction-hdl_unit_exid_into = 'D'.
ls_hdunitemaction-hdl_unit_exid = 'D'.
ls_hdunitemaction-deliv_numb = 'D'.
ls_hdunitemaction-deliv_item = 'D'.
ls_hdunitemaction-pack_qty = 'D'.
ls_hdunitemaction-sales_unit = 'D'.
ls_hdunitemaction-sales_unit_iso = 'D'.
ls_hdunitemaction-material = 'D'.
APPEND ls_hdunitemaction TO lt_hdunitemaction.
CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
EXPORTING
headerdata = ls_headerdata
headerdataaction = ls_headerdataaction
* TECHNCONTROL = TECHNCONTROL
TABLES
* HEADERDEADLINE = HEADERDEADLINE
* HEADERDEADLINEACTION = HEADERDEADLINEACTION
* ITEMDATA = ITEMDATA
* ITEMDATAACTION = ITEMDATAACTION
* STAGEDATA = STAGEDATA
* STAGEDATAACTION = STAGEDATAACTION
* STAGEDEADLINE = STAGEDEADLINE
* STAGEDEADLINEACTION = STAGEDEADLINEACTION
* ITEMONSTAGE = ITEMONSTAGE
* ITEMONSTAGEACTION = ITEMONSTAGEACTION
* ADDRESS = ADDRESS
* ADDRESSACTION = ADDRESSACTION
hdunheader = lt_hdunheader
hdunheaderaction = lt_hdunheaderaction
hdunitem = lt_hdunitem
hdunitemaction = lt_hdunitemaction
return = lt_return.
DELETE lt_return WHERE ( type EQ 'S' OR type EQ 'I' OR type EQ 'W' ).
IF lt_return IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_return.
ENDIF.