2008 Apr 17 3:17 PM
Hello All,
I'm trying to use BAPI_SHIPMENT_CHANGE to remove a delivery from a shipment. The RETURN structure continually returns a message saying that the Shipment could not be changed. Has anyone used this BAPI with any success? Could you help me with the data structures?
I have also tried SD_DELIVERY_ASSIGN_TO_SHIPMENT and SD_SHIPMENTS_SAVE with no proper results.
Has anyone had to programmatically remove a delivery from a shipment?
Thanks in advance.
--Jack
2008 Apr 17 4:02 PM
Hi JACK,
Get the deliveries assigned to a shipment using RV_SHIPMENT_VIEW. Then use SD_DELIVERY_ASSIGN_TO_SHIPMENT to delete or assign delieveries. Then do a save using SD_SHIPMENTS_SAVE.
There is documentation associated with SD_DELIVERY_ASSIGN_TO_SHIPMENT
Regards
Kiran Sure
Thanks for the help, that's not quite working though. Here's the code I'm using. I'm trying to remove all deliveries from the shipment, so I've left the I_DELIVERIES table blank...
* Remove delivery from shipment
SELECT SINGLE * FROM vttk WHERE tknum = l_ntknum.
CALL FUNCTION 'RV_SHIPMENT_VIEW'
EXPORTING
shipment_number = vttk-tknum
LANGUAGE = SY-LANGU
OPTION_ITEMS = 'X'
IMPORTING
F_VTTKVB = xvttk
TABLES
F_VTTP = xvttp.
CALL FUNCTION 'SD_DELIVERY_ASSIGN_TO_SHIPMENT'
EXPORTING
i_tknum = vttk-tknum
TABLES
c_xvttp = xvttp
c_yvttp = yvttp
c_xvtsp = xvtsp
c_yvtsp = yvtsp
i_deliveries = deliveries
i_xtrlk = xtrlk
i_xtrlp = xtrlp
i_xvtts = xvtts
CHANGING
c_xvttk = xvttk.
APPEND xvttk to xvttk_t.
CALL FUNCTION 'SD_SHIPMENTS_SAVE'
EXPORTING
i_transaktionstyp = 'V'
TABLES
i_xvttk = xvttk_t
i_yvttk = yvttk_t
i_xvttp = xvttp
i_yvttp = yvttp.See anything wrong? It's having no effect on the shipment at all.
Thanks again.
--Jack
2008 Apr 17 4:02 PM
Hi JACK,
Get the deliveries assigned to a shipment using RV_SHIPMENT_VIEW. Then use SD_DELIVERY_ASSIGN_TO_SHIPMENT to delete or assign delieveries. Then do a save using SD_SHIPMENTS_SAVE.
There is documentation associated with SD_DELIVERY_ASSIGN_TO_SHIPMENT
Regards
Kiran Sure
2008 Apr 17 4:20 PM
Thanks for the help, that's not quite working though. Here's the code I'm using. I'm trying to remove all deliveries from the shipment, so I've left the I_DELIVERIES table blank...
* Remove delivery from shipment
SELECT SINGLE * FROM vttk WHERE tknum = l_ntknum.
CALL FUNCTION 'RV_SHIPMENT_VIEW'
EXPORTING
shipment_number = vttk-tknum
LANGUAGE = SY-LANGU
OPTION_ITEMS = 'X'
IMPORTING
F_VTTKVB = xvttk
TABLES
F_VTTP = xvttp.
CALL FUNCTION 'SD_DELIVERY_ASSIGN_TO_SHIPMENT'
EXPORTING
i_tknum = vttk-tknum
TABLES
c_xvttp = xvttp
c_yvttp = yvttp
c_xvtsp = xvtsp
c_yvtsp = yvtsp
i_deliveries = deliveries
i_xtrlk = xtrlk
i_xtrlp = xtrlp
i_xvtts = xvtts
CHANGING
c_xvttk = xvttk.
APPEND xvttk to xvttk_t.
CALL FUNCTION 'SD_SHIPMENTS_SAVE'
EXPORTING
i_transaktionstyp = 'V'
TABLES
i_xvttk = xvttk_t
i_yvttk = yvttk_t
i_xvttp = xvttp
i_yvttp = yvttp.See anything wrong? It's having no effect on the shipment at all.
Thanks again.
--Jack
2011 Jul 01 4:03 PM
Hi Jack,
The only thing missing is COMMIT WORK after all those FMs
2009 Apr 24 3:02 PM
Hi Jack,
make sure that xvttk has update flag UPDKZ = 'U':
...
xvttk-updkz = 'U'.
APPEND xvttk TO xvttk_t.
...
Regards
Christian
2009 Apr 28 4:08 PM
Hi All!
I´m trying to do the same, unassign deliveries from the shipment using this functions but it does not have any effect on the shipment.
I copied the same code as above, also updkz = 'U' but it does not works...
Can anyone help me?
Thanks!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |