09-04-2008 10:17 AM
Hi There,
I have used BAPI_SALESDOCUMENT_CHANGE to change a Sales Order.
I was wondering is there another BAPI that I can use to delete the Sales Order?
Many Thanks,
Colm
09-04-2008 5:35 PM
Hi,
Please check the sample code..
DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: BAPISDH1X LIKE BAPISDH1X.
PARAMETERS: P_VBELN LIKE VBAK-VBELN.
*SET THE DELETION FLAG
BAPISDH1X-UPDATEFLAG = 'D'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = P_VBELN
order_header_inx = BAPISDH1X
tables
return = T_RETURN
.
COMMIT WORK.
Thanks
Naren
09-04-2008 10:18 AM
Try 'BAPI_SALESSUPDOCUMENT_DELETE' to delete sales order.
Regards,
Aparna Gaikwad
09-04-2008 5:21 PM
This FM appears useful due to its name but there doesn't appear to be any source code in there to do anything.
Do you have an example of how I might use it?
09-04-2008 5:23 PM
Hi,
Use the same bapi or BAPI_SALESORDER_CHANGE. ...and pass order_header_inx-updateflag = 'D'...
Thanks
Naren
09-04-2008 5:32 PM
Thanks Naren,
However when I try to do this I get the following message:
Field header_inx-updateflag is not an input field
Any ideas?
09-04-2008 5:35 PM
Hi,
Please check the sample code..
DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: BAPISDH1X LIKE BAPISDH1X.
PARAMETERS: P_VBELN LIKE VBAK-VBELN.
*SET THE DELETION FLAG
BAPISDH1X-UPDATEFLAG = 'D'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = P_VBELN
order_header_inx = BAPISDH1X
tables
return = T_RETURN
.
COMMIT WORK.
Thanks
Naren
09-04-2008 5:41 PM