‎2009 Oct 24 12:40 AM
Hi,
I am using BAPI BAPI_SHIPMENT_CHANGE to delete the shipments but it is not working correctly. It is deleting shipments from the header table VTTK but not deleting the line items from the VTTP thus causing inconsistency in the data base table. It should delete shipments from VTPP too.
Here is the code:
lwa_headerdata_ship-shipment_num = t_shipment-tknum.
lwa_headerdataaction_ship-shipment_num = 'D'.
call function 'BAPI_SHIPMENT_CHANGE'
exporting
headerdata = lwa_headerdata_ship
headerdataaction = lwa_headerdataaction_ship
tables
return = t_return.
Appreciate any help.
Thank you,
Rohit
‎2009 Oct 24 4:57 AM
Hi,
your BAPI is not released for customers. Have a look at note 1083509 - Point 5. So it looks like you found another issue but unfortunately for you there is no support from SAP for this BAPI.
Cheers
‎2009 Oct 26 3:34 PM
If I can't use this BAPI is there any othe BAPI or function module I can use to delete the shipments.
‎2012 Oct 01 7:27 PM
Hi,
I had the same problem and decided to fill the ITEMDATA structure and IT'S WORKS !
Do not forget to fill the structure ITEMDATAACTION with the letter D (delete) in the two fields (DELIVERY and ITENERARY).
Therefore, the abap soure code should be like:
lwa_headerdata_ship-shipment_num = t_shipment-tknum.
lwa_headerdataaction_ship-shipment_num = 'D'.
select VBELN from VTTP where VTTK = t_shipment-tknum.
lwa_ITEMDATA-DELIVERY = VTTP-VBELN.
lwa_ITEMDATAACTION-DELIVERY = 'D'.
lwa_ITEMDATAACTION-ITENERARY = 'D'.
call function 'BAPI_SHIPMENT_CHANGE'
exporting
headerdata = lwa_headerdata_ship
headerdataaction = lwa_headerdataaction_ship
tables
ITEMDATA = lwa_ITEMDATA
ITEMDATAACTION = lwa_ITEMDATAACTION
return = t_return.
‎2015 May 21 7:56 AM