Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Delete A Sales Order

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question