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: 

Delivery date not updated in Schedule line

former_member201227
Active Participant
0 Kudos

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

2 REPLIES 2

former_member182040
Active Contributor
0 Kudos

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.

0 Kudos

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