Application Development 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: 

Update shipment status using BAPI_SHIPMENT_CHANGE For Planning ,Check-in in database

former_member755182
Discoverer
0 Kudos

Hello Experts,

I have written one driven program to update this shipment status in database as well as in the VT02N.

Here I am attaching my code please correct me if anything is wrong.

DATA: w_headerdata TYPE bapishipmentheader,
w_headerdataaction TYPE bapishipmentheaderaction,
w_transport LIKE bapishipmentids-shipmentnum.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: t_itemdata LIKE bapishipmentitem OCCURS 0 WITH HEADER LINE,
ld_CV_DATE TYPE DATUM ,
ld_CV_TIME TYPE UZEIT,
t_itemdataaction LIKE bapishipmentitemaction OCCURS 0 WITH HEADER LINE.
DATA: l_transporte TYPE vbeln_nach,
l_error TYPE c LENGTH 1.
DATA return.

w_headerdata-SHIPMENT_NUM = '1200012352'.

w_headerdata-STATUS_PLAN = 'X'.
w_headerdataaction-STATUS_PLAN = 'C'.


CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
EXPORTING
headerdata = w_headerdata
headerdataaction = w_headerdataaction

return = t_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = abap_true.

1 REPLY 1

former_member751591
Participant
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend you to read this overview Community Q&A, and to take our Q&A tutorial . With these tips you'll be able to prepare questions that draw responses from our members.

The more details you provide, the more likely it is that members will be able to answer your question.

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a Picture to your profile you encourage readers to respond.