cancel
Showing results for 
Search instead for 
Did you mean: 

Adding multiple deliveries to a shipment

Former Member
0 Kudos

Hi all,

My requirement is to add multiple deliveries to a shipment. for that I am using a BAPI, SD_DELIVERY_ASSIGN_TO_SHIPMENT. In the description of this, it is said that we can append deliveries to shipment. But, i am not able to do so.

I have passed the shipment number in export parameter and all the header related info in changing parameters.

In the tables parameters, I have passed the data as below

C_XVVTP:

MAN TKNUM TPNU VBELN

200 2039 0002 13000926

200 2039 0001 13000925

C_YVTTP:

MAN TKNUM TPNU VBELN

200 2039 0002 13000926

200 2039 0001 13000925

C_XVTSP:

MAN TKNUM TSNU TPNU U

200 2039 0002 0002 I

200 2039 0001 0001 I

C_YVTSP:

MAN TKNUM TSNU TPNU U

200 2039 0001 0002 I

200 2039 0001 0001 I

I_DELIVERIES:

VBELN TPRF

13000926 0002

13000925 0001

I_XTRLK:

VBELN

13000926

13000925

I_XTRLP:

VBELN POSNR

13000926 000002

13000925 000001

I_XVTTS:

MAN TKNUM TSNU T

200 2039 0002 I

200 2039 0001 I

By passing the data in this format, I am not able to add deliveries to the shipment. It is not returning any message or error. Can anyone please tell me if there is any parameter i am missing or if I should call any other FM after using this, or any other BAPI altogether which meets the fuctionality to add many deliveries to a shipment.

Thanks and Regards,

Avinash

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor
0 Kudos

1) SD_DELIVERY_ASSIGN_TO_SHIPMENT is not a BAPI. I would not recommend to call the SAP function modules directly.

2) BAPI_SHIPMENT_CHANGE has not been released to the customers, so there is no support for it. I have used it though to delete a delivery from the shipment (see the example below), so it does work. You'll need to experiment with the fields you fill in. Also search ABAP forum.

DATA: s_header TYPE bapishipmentheader,
        s_headeraction TYPE bapishipmentheaderaction,
        i_item TYPE bapishipmentitem OCCURS 0 WITH HEADER LINE,
        i_itemaction TYPE bapishipmentitemaction OCCURS 0 WITH HEADER LINE,
        i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE.

  s_header-shipment_num = i_deliveries-tknum.  " Shipment Nr
  i_item-delivery = p_delivery.  " Delivery Nr
  APPEND i_item.
  i_itemaction-delivery = 'D'.
  i_itemaction-itenerary = 'D'.
  APPEND i_itemaction.

  CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
    EXPORTING
      headerdata       = s_header
      headerdataaction = s_headeraction
    TABLES
      itemdata         = i_item
      itemdataaction   = i_itemaction
      return           = i_return.

0 Kudos

Hi Jelena,

BAPI_SHIPMENT_CHANGE works great.

Thank you.

Former Member
0 Kudos

Hi,

Any new BAPI may also solve my problem of adding many deliveries to a single shipment.

I have tried using BAPI_SHIPMENT_CHANGE also. But I am not able to do it.

So, any new BAPI may serve as input.

Regards,

Avinash