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

Problem in updating Quantity using 'BAPI_SALESORDER_CHANGE'

Former Member
0 Likes
755

Hi,

I am using Bapi_salesorder_change to update item quantity and reason for rejection.My code is as below.

MOVE c_u TO e_orderheader_inx-updateflag.

FREE i_orderitem_in.

MOVE newitem-posnr_ref TO e_orderitem_in-itm_number.

MOVE c_rej TO e_orderitem_in-reason_rej.

MOVE c_qt TO e_orderitem_in-target_qty.

APPEND e_orderitem_in TO i_orderitem_in.

FREE i_orderitem_inx.

MOVE newitem-posnr_ref TO e_orderitem_inx-itm_number .

MOVE c_u TO e_orderitem_inx-updateflag.

MOVE c_x TO e_orderitem_inx-reason_rej.

MOVE c_x TO e_orderitem_inx-target_qty .

APPEND e_orderitem_inx TO i_orderitem_inx.

FREE i_return.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = xvbak-vbeln

  • ORDER_HEADER_IN =

order_header_inx = e_orderheader_inx

TABLES

return = i_zbapiret2

order_item_in = i_orderitem_in

order_item_inx = i_orderitem_inx.

But in 'i_zbapiret2' iam getting the below errors.

1)Storage location BH in plant is not defined .

2) Error in ITEM_IN 000020

3) sales documnet 000078965 was not changed.

PLease help me to solve this problem.

Thanks in advance,

Sravanthi.

Hi,

Try giving the same value as in your existing order. If there are no values in existing Sales order then try giving item number in this line. You can get schedule lines in VBEP table.

KR Jaideep,

4 REPLIES 4
Read only

jaideepsharma
Active Contributor
0 Likes
691

Hi,

Pass the quanities in schedulelines and schdulelinex parameter also.

Also, from the code I can see that you are not passing header data in the BAPI.

Please pass the header data as well.

KR Jaideep,

Read only

0 Likes
691

Hi Jaideep,

Can you pls explain me what are the parameters I need to pass to schduleline. I could not understand what value to be passed to SCHEDULE_LINES-SCHED_LINE.

Thanks,

Sravanthi

Read only

0 Likes
691

Hi,

Try giving the same value as in your existing order. If there are no values in existing Sales order then try giving item number in this line. You can get schedule lines in VBEP table.

KR Jaideep,

Read only

Former Member
0 Likes
691

Hi,

From the error message it seems that you dont have the storage location for the plant as you have passed to the BAPI check table 'T001L' to see if that storage location is there for the plant. If not then we need to maintain that.

Regards,

Himanshu