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.
Table of Contents
Context
Delete entity can be implemented by redefining the DELETE_ENTITY method.
Procedure
- Open *DPC_EXT class artifact of OData and redefine *DELETE_ENTITY method.
- Reimplement the delete method.
IT_KEY_TAB holds the values from the frontend. - Activate the class and register the service.
- Execute and test the OData.
- Select Entity set
- Select DELETE option
- Add the key value to be deleted in the request URL
- Execute the request
- Status 204 represents success.
- Verify in the table the record is successfully deleted.
0 Comments