2008 Nov 06 3:22 AM
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.
2008 Nov 06 3:56 AM
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
2008 Nov 06 3:37 AM
2008 Nov 06 3:43 AM
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.
2008 Nov 06 3:45 AM
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
2008 Nov 06 3:56 AM
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
2008 Nov 07 5:16 AM
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.