Step-by-Step Guide to Deleting a RAP Project in SAP

Step-by-Step Guide to Deleting a RAP Project in SAP

SAP RAP

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:

SAP RAP Project Delete

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:

SAP RAP Project Delete

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:

SAP RAP Project Delete

Open the Service Binding, click Unpublish, and wait a bit:

Once it’s unpublished, you can safely delete the service binding:

Delete service binding


2️⃣ Delete the Service Definition

Next, delete the Service Definition:

Delete 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:

  1. Service Binding

  2. Service Definition

  3. Behavior Projection's Implementation Class

  4. Behavior Projection

  5. Behavior Definition's Implementation Class

  6. Behavior Definition

  7. Metadata Extension

  8. Access Control

  9. CDS Data Definition – Projection View

  10. CDS Data Definition – Interface View

  11. Database Table


🧱 What If Your RAP Project Has Parent-Child Entities?

For RAP projects with parent-child hierarchies, the order becomes:

  1. Service Binding

  2. Service Definition

  3. Behavior Projection

  4. Behavior Definition's Implementation Class

  5. Behavior Definition

  6. Metadata Extension

  7. Access Control

  8. CDS Projection View – Child

  9. CDS Projection View – Parent

  10. CDS Interface View – Child

  11. CDS Interface View – Parent

  12. 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!

Tags: #saprap