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 Problem

Former Member
0 Likes
1,401

Hi All!...

I'm having a problem with this BAPI, the problem is that I'm trying to change the quantity of the materials, and the bapi returns the following message: "Missing item number when you changed the schedule line". And I don't know why because as you can see on my code the item number is present in both structures.

es_bapisdh1x-updateflag = 'U'.

APPEND es_bapisdh1x.

es_bapischdl_2-itm_number = ti_vbap-posnr.

es_bapischdl_2-req_qty = ti_pos_pedido-cant_vend.

APPEND es_bapischdl_2.

es_bapischdlx-itm_number = ti_vbap-posnr.

es_bapischdlx-updateflag = 'U'.

es_bapischdlx-req_qty = 'X'.

APPEND es_bapischdlx.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = vbeln

order_header_inx = es_bapisdh1x

TABLES

return = es_bapiret2_2

schedule_lines = es_bapischdl_2

schedule_linesx = es_bapischdlx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Hope any of you knows whats happening..

Thanks a lot

Maria

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
674

I believe that you need to give the scheudule line number as well. How else would it know which schedule line to update. There can be multiple schedule lines to a line item.

Give it a try.

es_bapischdl_2-SCHED_LINE = '0001'.

Regards,

Rich Heilman

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
675

I believe that you need to give the scheudule line number as well. How else would it know which schedule line to update. There can be multiple schedule lines to a line item.

Give it a try.

es_bapischdl_2-SCHED_LINE = '0001'.

Regards,

Rich Heilman