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: 

VBAP table is not getting updated through BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Hi Experts,

I have suspended an order, there is a back ground job which use to reinstate it automatically but now it not changing its status to reinstate i have checked that inside BAPI_SALESORDER_CHANGE , i am getting error message adline status can not be changed and sales document was not changed.

Please help me on this.

Thanks,

Trupti

3 REPLIES 3

Former Member
0 Kudos

Hi,

Check the Lock statsu of the sales order.

and check whether are you passing the Item detials .

above all check the Bapi return messages for correct reason.

Prabhudas

SimoneMilesi
Active Contributor
0 Kudos

What number and class message the system returns?

I cannot understand the error type you get 😕

Former Member
0 Kudos

after 'BAPI_SALESORDER_CHANGE u have to call 'BAPI_TRANSACTION_COMMIT


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.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.

LOOP AT it_return.
  WRITE / it_return-message.
ENDLOOP.