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

BAPI_SALESORDER_CHANGE, change ordered quantity

Former Member
0 Likes
1,418

Dear Reader,

The BAPI_SALESORDER_CHANGE is not changing the ordered quantity when giving the field ITEM-TARGET_QTY a new value.

Another field (reason of rejection ITEM-REASON_REJ)in the same program but in a different occasion is changing definately.

Here by the source:

w_headerx-updateflag = 'U'.

w_itemx-ITM_NUMBER = p_posnr.

w_itemx-updateflag = 'U'.

w_itemx-TARGET_QTY = 'X'.

append w_itemx to t_itemx.

w_item-ITM_NUMBER = p_posnr.

w_item-TARGET_QTY = w_vbap1-kwmeng.

move w_vbap1-kwmeng to w_item-TARGET_QTY.

append w_item to t_item.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = p_vbeln

ORDER_HEADER_INX = w_headerx

SIMULATION = ' '

TABLES

RETURN = t_return

ORDER_ITEM_IN = t_item

ORDER_ITEM_INX = t_itemx

Thanks in advance for your support and advise.

Regards,

Adriaan Knappert

06-14337908

7 REPLIES 7
Read only

Former Member
0 Likes
1,370

Hi,

may be you forgot the commit work?

Siggi

Read only

0 Likes
1,370

Dear Siggi,

Thanks for your reply. I've the call function BAPI_TRANSACTION_COMMIT after my function. So this is not the solution.

Regards,

Adriaan Knappert

Read only

0 Likes
1,370

Hi, Adriaan,

Have you tried also adding the schedule line information for the related order line as well into the BAPI ?

Kind regards

Colin.

Read only

0 Likes
1,370

Dear Colin,

Thanks for your further interest. I've added three fields according the schedule lines but still the amount has been unchanged.

w_schedulex-ITM_NUMBER = p_posnr.

w_schedulex-REQ_QTY = 'X'.

w_schedulex-updateflag = 'U'. "ins AAK

w_schedulex-SCHED_LINE = 'X'.

append w_schedulex to t_schedulex.

w_schedule-ITM_NUMBER = p_posnr.

w_schedule-SCHED_LINE = '0001'.

move w_vbap1-kwmeng to w_schedule-req_qty.

Regards,

Adriaan Knappert

Read only

0 Likes
1,370

Hi,

In your code you do not seem to append W_SCHEDULE to anything. Is it appended to SCHEDULE_LINES ?

Also, are you getting anything returned in the RETURN table when you execute the function ?

Kind regards

Colin

Read only

Former Member
0 Likes
1,370

Hi,

Call function BAPI_TRANSACTION_COMMIT after your function.

Kind regards

Colin.

Read only

0 Likes
1,370

Hi Colin,

Thanks for your reply. I've the call function BAPI_TRANSACTION_COMMIT after my function. So this is not the solution.

Regards,

Adriaan Knappert