2011 Jul 29 2:52 PM
Hi All,
I need a help in solving the problem with the BAPI 'BAPI_SALESORDER_CHANGE' while tryihg to update the sales order with the reason for rejection it returning a error message with 'Enter Document Number'.
I believe this could be avoided by using the STARTING NEW TASK with the bapi. Could anyone please guide to get the problem resolved.
Thanks in advance.
Thanks,
Karthik
Hi All,
I need a help in solving the problem with the BAPI 'BAPI_SALESORDER_CHANGE' while tryihg to update the sales order with the reason for rejection it returning a error message with 'Enter Document Number'.
I believe this could be avoided by using the STARTING NEW TASK with the bapi. Could anyone please guide to get the problem resolved.
Thanks in advance.
Thanks,
Karthik
2011 Jul 29 2:56 PM
Are you passing the document number to the BAPI? the error message looks so
2011 Jul 29 4:22 PM
2011 Aug 01 7:49 AM
Hi,
Below is the code which has been written in a method.
clear: ex_subrc,
wa_bapisditm,
wa_bapisditmx,
wa_bapisdh1x,
wa_return,
it_return,
it_bapisditm,
it_bapisditmx.
if t_rejvbap is initial.
exit.
endif.
*--Prepare data
loop at t_rejvbap into wa_vbap.
wa_bapisditm-itm_number = wa_vbap-posnr.
wa_bapisditm-material = wa_vbap-matnr.
wa_bapisditm-reason_rej = k_02.
wa_bapisditmx-itm_number = wa_vbap-posnr.
wa_bapisditmx-reason_rej = k_x.
append wa_bapisditm to it_bapisditm.
append wa_bapisditmx to it_bapisditmx.
clear: wa_bapisditm,
wa_bapisditmx.
endloop.
*--Update Flag
move : k_u to wa_bapisdh1x-updateflag.
*--Change Sales Order
SET UPDATE TASK LOCAL.
wait up to 5 seconds.
call function 'BAPI_SALESORDER_CHANGE'
exporting
salesdocument = im_vbak-vbeln
order_header_inx = wa_bapisdh1x
tables
return = it_return
order_item_in = it_bapisditm
order_item_inx = it_bapisditmx.
*--Rollback, if errors
read table it_return into wa_return with key type = k_e.
if sy-subrc eq 0.
call method zasa_automated_delship=>asa_fill_bapireturn
exporting
im_message = wa_return-message
im_vgbel = im_vbak-vbeln
im_bstnk = im_vbak-bstnk
im_vsbed = im_vsbed
changing
t_error = t_error.
ex_subrc = 1.
call function 'BAPI_TRANSACTION_ROLLBACK'.
exit.
endif.
*--Commit Change
clear: wa_return.
call function 'BAPI_TRANSACTION_COMMIT'
importing
return = wa_return.
wait up to 5 seconds.
if wa_return-type = k_e.
call function 'BAPI_TRANSACTION_ROLLBACK'.
call method zasa_automated_delship=>asa_fill_bapireturn
exporting
im_message = wa_return-message
im_vgbel = im_vbak-vbeln
im_bstnk = im_vbak-bstnk
im_vsbed = im_vsbed
changing
t_error = t_error.
ex_subrc = 1.
exit.
endif.
Kindly advise on the same as soon as possible. This is urgent.
Thanks,
Karthikeyan.
2011 Aug 01 8:00 AM
hi,
just check if , this variable is being populated in debug mode.
salesdocument = im_vbak-vbeln
2011 Aug 01 11:02 AM
2011 Aug 01 8:11 AM
Hi,
The parameters are passed i have checked in debugging mode. The solution is using parallel processing i believe by using 'STARTING NEW TASK'. Could anyone please suggest on the same.
Thanks,
Karthikeyan.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |