03-17-2011 7:16 AM
Hi friends,
We are trying to update the delivery date of a schedule line in a sale order item through BAPI_SALESDOCUMENT_CHANGE. This goes well for all the cases except when the last sale order item is fully delivered. When the last sale order item is fully delivered, the BAPI is unable to update the delivery date for any of the other schedule line items in the same sale order.
While debugging standard SAP program SAPMV45A, we found that the XVBUP item always points to the last sale order item (FM: SD_FIELD_INPUT_CHECK) and as this is fully delivered, it says that the order is completely delivered and hence delivery date EDATU cannot be changed.
Could anyone please help to resolve this issue?
Thanks,
Sharmila
Edited by: Sharmila Subramanian on Mar 17, 2011 8:17 AM
03-17-2011 12:22 PM
Use following function and update schedule_lines and schedule_linesx table.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = s_order_header_in
order_header_inx = s_order_header_inx
behave_when_error = 'P'
TABLES
return = it_return
order_item_in = i_order_item_in
order_item_inx = i_order_item_inx
schedule_lines = i_sched
schedule_linesx = i_schedx.
03-18-2011 3:57 AM
HI Krupaji,
Thanks for the reply... Solved the problem myself by using this BAPI only... Anyway thanks for replying..
How different BAPI_SALESDOCUMENT_CHANGE is from BAPI_SALESORDER_CHANGE? I was not able to figure it out.
Thanks,
Sharmila