Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_SHIPMENT_CHANGE Issue

Former Member
0 Likes
3,890

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

4 REPLIES 4
Read only

mvoros
Active Contributor
0 Likes
1,482

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

Read only

Former Member
0 Likes
1,482

If I can't use this BAPI is there any othe BAPI or function module I can use to delete the shipments.

Read only

alexandre_cristovao
Participant
0 Likes
1,482

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.

Read only

0 Likes
1,482

D is the right parameter ...

regards

ashutosh