Deleting a full RAP (RESTful Application Programming) project in the ABAP environment isn't as straightforward as right-clicking and selecting "Delete." If you try to delete the entire package containing all your RAP development objects, you’re likely to encounter dependency errors due to the tightly connected structure of these objects.
Let’s go step-by-step and understand the right way to clean up a RAP project.
⚠️ The Error When You Delete a Package Directly
When you try to delete the full package directly, you'll see an error like this:
This happens because all the development objects in a RAP project are interdependent. You cannot delete them all at once.
If we take a look at the package contents:
You'll notice that the RAP framework generates a variety of tightly coupled objects, service bindings, definitions, behaviors, CDS views, tables, and more.
🔁 So, What’s the Right Deletion Order?
The trick is to delete the objects in reverse order of creation.
Typically, a RAP project ends with the creation of the Service Binding. So, we'll begin by deleting that.
1️⃣ Delete the Service Binding
But wait, before deleting, make sure it’s unpublished, otherwise you'll get this error:
Open the Service Binding, click Unpublish, and wait a bit:
Once it’s unpublished, you can safely delete the service binding:
2️⃣ Delete the Service Definition
Next, delete the Service Definition:
3️⃣ Delete Behavior & Supporting Objects
Now continue in this order:
-
Delete the implementation class of the behavior definition (if created).
-
Delete the Behavior Definition.
-
Delete Metadata Extension and Access Control (if available).
-
Delete the CDS Data Definition.
-
Finally, delete the Database Table.
And done! You've removed the entire RAP project from your system.
🚫 Note: Don’t try this with real project deliverables unless you're 100% sure.
📦 What If Your RAP Project Has Projections?
If your project includes projection layers, then the order changes slightly. Here's the revised deletion order:
-
Service Binding
-
Service Definition
-
Behavior Projection's Implementation Class
-
Behavior Projection
-
Behavior Definition's Implementation Class
-
Behavior Definition
-
Metadata Extension
-
Access Control
-
CDS Data Definition – Projection View
-
CDS Data Definition – Interface View
-
Database Table
🧱 What If Your RAP Project Has Parent-Child Entities?
For RAP projects with parent-child hierarchies, the order becomes:
-
Service Binding
-
Service Definition
-
Behavior Projection
-
Behavior Definition's Implementation Class
-
Behavior Definition
-
Metadata Extension
-
Access Control
-
CDS Projection View – Child
-
CDS Projection View – Parent
-
CDS Interface View – Child
-
CDS Interface View – Parent
-
Database Tables (Child and Parent)
✅ Summary
RAP projects are structured and layered, so deletion must be methodical. Always follow reverse creation order, especially when dealing with:
-
Published service bindings
-
Behavior implementations
-
Projection layers
-
Parent-child entity relationships
Taking care of dependencies will save you from a lot of frustration and system errors!