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: 

Updation Error in Schedule line category using 'BAPI_SALESORDER_CHANGE'

Former Member
0 Kudos

HI ,

I am using BAPI_SALESORDER_CHANGE to Update schedule line category for an order.But the issue is...the entries are updated if it is having single schedule line item,but if more than on item it is giving error in Last Record.

15192625 000200 0001 2.608.596.065 130,000 21.09.2009 ZX CP

*15192625 000200 0002 2.608.596.065 0,000 04.02.2010 ZX CP

*EV1 335System error: Schedule line 0002 for item 000200 does not exist

EV4 219Sales document 0015192625 was not changed

i have written the code like below:

loop at i_ma4_etenr.

i_salesdocument = i_ma4_etenr-vbeln.

i_order_header_inx-updateflag = 'U'.

r_schedule_lines-itm_number = i_ma4_etenr-posnr.

r_schedule_lines-sched_line = i_ma4_etenr-etenr.

r_schedule_lines-sched_type = i__ma4_etenr-ettyp .

APPEND r_schedule_lines TO i_schedule_lines.

CLEAR : r_schedule_linesx.

r_schedule_linesx-itm_number = i_y16v_ma4_etenr-posnr.

r_schedule_linesx-sched_line = i_y16v_ma4_etenr-etenr.

r_schedule_linesx-updateflag = 'U'.

r_schedule_linesx-sched_type = 'X'.

APPEND r_schedule_linesx TO i_schedule_linesx.

endloop.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = i_salesdocument

order_header_inx = i_order_header_inx

TABLES

return = i_return

schedule_lines = i_schedule_lines

schedule_linesx = i_schedule_linesx.

Thanks in Advance,

Sateesh Kumar.

3 REPLIES 3

Former Member
0 Kudos

Hi,

As you are facing error , so check wheather in VA02 schedule line fields have been uploaded or not initially.

If they are not uploaded then you will be facing the error.

Otherwise check:

Did you pass the X fields for the schedule lines properly. As you are changing only the schedule lines, Just pass the SCHEDULE_LINES , SCHEDULE_LINESX Internal tables.

Please also check whether anything is passed to ORDER_ITEM_INX- UPDATE field. it should be blank.

May it helps you.

Regards,

DS.

Former Member

Hi Sateesh,

I'm not clear if you are trying to insert or update.

If you are inserting then set SCHEDULE_LINESX-updateflag = 'I' OR ' '. Since, you have given the flag as 'U', It is checking if already existing.

Hope it helps.

Sujay

Former Member
0 Kudos

Hi,

Have you resolved the issue. If you resolved can you please share it.