‎2014 Jan 17 7:11 AM
I need to delete sales order but i am unable to delete that, although i have used the BAPI_SALESORDER_CHANGE also and provided the D as the deletion flag at item and header section .After that i have used the commit also then also it is showing the error of the document could not be deleted.
Please provide some useful solutions.
‎2014 Jan 17 7:21 AM
Is this the only message you get in return table or their are more?? A small thing when you want to delete sales order only pass header for deletion
nabheet
‎2014 Jan 17 7:53 AM
This small message i am only getting and i have checked with header only then also i am geting that error i.e.,this document cannot be deleted .Now what could be the possible cause of it i am not getting.
‎2014 Jan 17 7:31 AM
Hi,
Have you done this like below!
ls_order_header_in-doc no =
ls_order_header_inx-updateflag = 'U'.
lt_ord_itm_inx-updateflag = 'U'.
lt_ord_itm_in-itm_number = ltem
lt_ord_itm_inx-itm_number = ltems
‎2014 Jan 17 7:56 AM
i am doing like this
wg_order_header_in-collect_no = g_vbak-vbeln.
wg_order_header_inx-collect_no = 'X'.
wg_order_header_inx-updateflag = 'D'.
wg_order_item_in-itm_number = wg_vbap-posnr.
wg_order_item_inx-itm_number = 'X'.
wg_order_item_inx-updateflag = 'D'.
‎2014 Jan 17 7:57 AM
Hi Abhigyan,
Not sure which user you are using to execute the BAPI. Might sounds silly but who knows if its executed from an external user triggered via web service? My suggestion is to login using that User and try deleting the order manually using VA02 first. See what is the error you faced.
Thanks
Leonard
‎2014 Jan 17 9:24 AM
Leonard thanks for your answer but i need to delete many sales order and with this utility program it would be very easy if it executes as i can give some further conditions so that at a time the particular category sales order will be deleted at once no need to go again and again to delete them .
‎2014 Jan 17 12:23 PM
Yes. I understand and i am not suggesting you not doing the bapi. All i recommend is to make sure you can at least manually delete the sales order in foreground before you test in bapi due to the limited error logs provided. The user you used to test in foreground is critical. It has to be the username that you used to test your bapi as well.