Application Development and Automation 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: 
Read only

quantity update using the BAPI_SALESORDER_CHANGE

Former Member
0 Likes
977

Hi,

i unable to updating quantity field using the BAPI_SALESORDER_CHANGE.

I think may be problem with schedule lines.If Possible please tell me what are fields data is mandatory while changing sales order quantity.

Regards,

suresh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
673

To update the quantity, update quantity in both Item and schedule line structures.

Try below code

order_item_in-itm_number  = <item number>
order_item_inx-itm_number = <item number>.
order_item_inx-updateflag = 'U.

order_item_in-target_qty  = wa_vbap-kwmeng.
order_item_inx-target_qty = 'X'.

schedule_lines-itm_number = <item number>
schedule_lines-sched_line = <Schedule LIne No> .
schedule_lines-req_qty    = <Quantity>.

schedule_linesx-itm_number  = <item number>
schedule_linesx-sched_line  = <Schedule LIne no>
schedule_linesx-updateflag  = 'U'.
schedule_linesx-req_qty     = 'X'.

Regards

Vinod

Hi,

i unable to updating quantity field using the BAPI_SALESORDER_CHANGE.

I think may be problem with schedule lines.If Possible please tell me what are fields data is mandatory while changing sales order quantity.

Regards,

suresh

3 REPLIES 3
Read only

Former Member
0 Likes
673

Hi,

Just a small tip which we some time miss, Commit after calling BAPI.

Also mark the field as X which you want to change.

Read only

0 Likes
673

Hi Suresh,

You have set the update mode(UPD) as 'U' and need to set 'X' for the target_qty in the X structure of the BAPI.

in BAPISDITM

set TARGET_QTY = 2. " what ever the qty you need

In BAPISDITMX structure

for UPDATEFLAG set 'U'

and for TARGET_QTY = 'X'.

hope this helps

Thanks,

Srini.

Read only

Former Member
0 Likes
674

To update the quantity, update quantity in both Item and schedule line structures.

Try below code

order_item_in-itm_number  = <item number>
order_item_inx-itm_number = <item number>.
order_item_inx-updateflag = 'U.

order_item_in-target_qty  = wa_vbap-kwmeng.
order_item_inx-target_qty = 'X'.

schedule_lines-itm_number = <item number>
schedule_lines-sched_line = <Schedule LIne No> .
schedule_lines-req_qty    = <Quantity>.

schedule_linesx-itm_number  = <item number>
schedule_linesx-sched_line  = <Schedule LIne no>
schedule_linesx-updateflag  = 'U'.
schedule_linesx-req_qty     = 'X'.

Regards

Vinod