Skip to Content
Mar 16, 2007 at 10:16 AM

ABAP Object - Persistent Services - Undelete


Dear all,

I'm developing some BAPIs according to the BAPI Programming Guidelines. I'm also using the Persistent Services to manage the persistence of my business object.

The BAPI Programming Guidelines describe the Delete method as "deletes an instance of an SAP business object type from the database" I've implemented this using persistent services with method DELETE_PERSISTENT.

I'd like to implement the undelete method.

According to the documentation at Management" target="_blank">">Management States, a persistent object deleted has state 4.

The state transition table suggests that the method CREATE_PERSISTENT can be applied to objects in state 4 - persistent deleted resulting in state 3 - persistent and has been changed.

If before a commit work, I wish to "undelete" the object, how can I achieve this? Ideally, I'd like to simply provide the business key or GUID and request an "undelete" on a deleted persistent object, of course before commit work has been triggered. I do understand I can use CREATE_PERSISTENT to create the object - but this requires that attributes are provided again...

Is there an UNDO method?

Any suggestions would be appreciated.



Message was edited by:

Andrew Barnard

Additional clarification acknowledging the possibility of using the CREATE_PERSISTENT method.