Delete an Entity using SAP OData

Preface – This post is part of the SAP ABAP OData Tutorial series.

Delete operation is used when you want to remove a record from the database. For example, you have created one quotation and now you no longer want it. So you will delete the quotation using the DELETE request.

This article describes the step-by-step procedure to implement and test delete operation in SAP OData.

Context

Delete entity can be implemented by redefining the DELETE_ENTITY method.

Procedure

  1. Open *DPC_EXT class artifact of OData and redefine *DELETE_ENTITY method.
  2. Reimplement the delete method.
    Delete an Entity using SAP OData
    IT_KEY_TAB holds the values from the frontend.
  3. Activate the class and register the service.
  4. Execute and test the OData.
    1. Select Entity set
    2. Select DELETE option
    3. Add the key value to be deleted in the request URL
    4. Execute the request
      Delete an Entity using SAP OData Testing
    5. Status 204 represents success.
    6. Verify in the table the record is successfully deleted.

Tutorial Video

You can watch the below video to learn implementation:

Author

  • Barry Allen

    A Full Stack Developer with 10+ years of experience in different domain including SAP, Blockchain, AI and Web Development.

    View all posts

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.