How to make SAP SRM PO in deleted status?

How to make SAP SRM PO in deleted status?

PO Archiving
Once the purchase order is ordered and issued, it is a legal document between your company and the vendor. Only PO line items can be deleted and you can not delete PO header.

Deleting line item of PO is not enough. Make sure that PR or SC history does not contain any follow on document else system will interpret this a close PR or SC.

Because the PO was already printed or output exist... You cannot delete PO header.

Once the PO has been issued to vendor in any form, deletion is not possible at the header level, only possibility is deleting line items of the PO (deletion indicator marked for all the line items of PO). Only when the PO is rejected by the approver (in case any, which will be in the 'release rejected' status) or in held state (before issued to vendor), PO can be deleted at the header level, as the data still exists in SRM and not get transferred to R3 backend. If you want to forcibly delete the PO at the header level, flag DOC_CLOSED field in the table BBP_PDHGP (header tabe) through BBP_PD for the respective PO.

<b>Try using the Function Modules "BBP_PD_PO_DB_DELETE".</b>

<b>BP_PD_PO_ITEM_DELETE_LOCAL</b>

<u>Some other relevant Function modules -></u>

BP_PD_PO_DB_DELETE_MULTI
BP_PD_PO_ITEM_DELETE_LOCAL
BBP_BS_POD : Spooler, delete PO
SPOOL_PO_DELETE :Spooler function to delete a po in core
SPOOL_PO_DELETE_DO :Spooler function to delete a po in core

Source