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: 

Has anyone ever used BAPI_SALES_DEL_SCHEDULE_CREATE

Former Member
0 Kudos
548

Hi Expert.

I need to create and change a Sale Forecast delivery scheduling agreement in tcode VA32 so I try to use function BAPI_SALES_DEL_SCHEDULE_CREATE but it dosen't work properly like as follow

I did call the fuction by passing parameters as below then the header of delivery schedule was created

but in item lines couldn't be created .

Do I miss to send some parameters? or can I use this functional or other suggestions would be great.

CALL FUNCTION 'BAPI_SALES_DEL_SCHEDULE_CREATE'

EXPORTING

salesdocument = g_salesdocument

  • ORDER_HEADER_IN =

order_header_inx = g_order_header_inx

  • SIMULATION = 'X'

  • BEHAVE_WHEN_ERROR = ' '

  • LOGIC_SWITCH =

TABLES

  • ORDER_ITEM_IN =

  • ORDER_ITEM_INX =

schedule_lines = g_tbl_schedule_lines

schedule_linesx = g_tbl_schedule_linesx

  • ORDER_TEXT =

del_schedule_in = g_tbl_del_schedule_in

del_schedule_inx = g_tbl_del_schedule_inx

  • CORR_CUM_QTY_IN =

  • CORR_CUM_QTY_INX =

  • PARTNERS =

  • SCHEDULE_EX = g_tbl_SCHEDULE_EX

  • DEL_SCHEDULE_EX = g_tbl_DEL_SCHEDULE_EX

  • CORR_CUM_QTY_EX =

  • EXTENSIONEX =

return = g_tbl_return.

Thanks for your replies.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
179

Since you are updating delivery schedules and it will be specific to each item, you might need to populate ORDER_ITEM_IN & ORDER_ITEM_INX. Try by populating details for items.

~Eswar

5 REPLIES 5

Former Member
0 Kudos
179

Please give the value you set for INX parameter..

Former Member
0 Kudos
179

Hello,

Try this

CALL FUNCTION 'BAPI_SALES_DEL_SCHEDULE_CREATE'

EXPORTING

salesdocument = lv_salesdocument

order_header_in = lf_order_header_in

order_header_inx = lf_order_header_inx

TABLES

order_item_in = lt_order_item_in

order_item_inx = lt_order_item_inx

schedule_lines = lt_schedule_lines

schedule_linesx = lt_schedule_linesx

order_text = lt_order_text

del_schedule_in = lt_del_schedule_in

del_schedule_inx = lt_del_schedule_inx

corr_cum_qty_in = lt_corr_cum_qty_in

corr_cum_qty_inx = lt_corr_cum_qty_inx

partners = lt_partners

schedule_ex = lt_schedule_ex

del_schedule_ex = lt_del_schedule_ex

extensionex = extensionin

return = lt_return.

Former Member
0 Kudos
179

Please check the INX parameter of item...you need to set 'I' for creation and 'U' for updation. check with the FM documentation.

hope it will work.

Regards

R

Edited by: Raghu on Nov 6, 2008 9:15 AM

Former Member
0 Kudos
180

Since you are updating delivery schedules and it will be specific to each item, you might need to populate ORDER_ITEM_IN & ORDER_ITEM_INX. Try by populating details for items.

~Eswar

Former Member
0 Kudos
179

Thanks for all suggestions.

we need to pass the same values between "schedule_lines-rel_type" which is a Release type and "schedule_linesx-rel_type" which seems to be "Updated information in related user data field" but actually is not .

Likes this

schedule_lines-rel_type = '1'.

schedule_linesx-rel_type = '1'.

but not like this

schedule_lines-rel_type = '1'.

schedule_linesx-rel_type = 'X'.

because you can have a look in source code in function SD_SALESDOCUMENT_CHANGE on ECC6 from line 635 to 638

loop at ex_vbepkomx where posnr = ex_vbepkom-posnr and

etenr = ex_vbepkom-etenr and

abart = ex_vbepkom-abart. " CMDS

endloop.

Sayan.