0% found this document useful (0 votes)
22 views4 pages

Sap Rap (Restful Application Programming)

SAP RAP is a modern programming model for developing cloud-ready applications on the SAP Business Technology Platform, focusing on OData-based services with a structured approach. It features a three-layer architecture comprising data, behavior, and service models, and offers benefits like faster development and simplified CRUD operations. The development workflow involves creating data models, defining and implementing behavior, and exposing services, along with advanced features like draft capabilities and concurrency control.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

Sap Rap (Restful Application Programming)

SAP RAP is a modern programming model for developing cloud-ready applications on the SAP Business Technology Platform, focusing on OData-based services with a structured approach. It features a three-layer architecture comprising data, behavior, and service models, and offers benefits like faster development and simplified CRUD operations. The development workflow involves creating data models, defining and implementing behavior, and exposing services, along with advanced features like draft capabilities and concurrency control.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SAP RAP (RESTful Application Programming)

1. Introduction to SAP RAP

What is SAP RAP?

SAP RAP is a modern programming model for developing cloud-ready, enterprise-grade


applications on the SAP Business Technology Platform (BTP) and SAP S/4HANA. It
simplifies and standardizes the development of OData-based services with a structured
approach.

Why SAP RAP over traditional approaches?

• Cloud-Ready: Designed for cloud and on-premises deployments.

• OData V4 Support: Ensures efficient and flexible API communication.

• Simplified Development: Reduces custom coding by using declarative and managed


scenarios.

• Clear Separation of Concerns: Data model, behavior, and service exposure are well-
structured.

Key Benefits:

• Faster development with standardized practices.

• Supports transactional consistency with draft capabilities.

• Simplifies CRUD operations and custom logic.

2. RAP Architecture

Three Layers of RAP:

• Data Model: Built using CDS (Core Data Services) views.

• Behavior Model: Defines operations like create, read, update, and delete (CRUD) along
with actions and validations.

• Service Model: Exposes the behavior and data models as OData services.
Scenarios in RAP:

• Managed Scenario: SAP manages data consistency and behavior.

• Unmanaged Scenario: Developers handle the business logic and data consistency.

• Static Scenarios: Used for read-only access.

3. Core Concepts

CDS Entities and Projections:

• CDS View: Defines the underlying data model.

• Projection View: Provides a specific view of the data model, often for service exposure.

Behavior Definition (BDEF):

Defines the operations (CRUD, actions) and how they behave.

Behavior Implementation (BIMP):

The ABAP class where business logic is implemented for the defined behavior.

Service Definition:

Defines which data and behavior models are exposed in the service.

Service Binding:

Binds the service definition to an OData protocol (like OData V4).

4. RAP Development Workflow

Step 1: Create Data Model with CDS Views

@EndUserText.label : 'Purchase Order'

define root view entity ZI_PurchaseOrder

key PurchaseOrderID : abap.numc(10);

Description : abap.char(50);

OrderDate : abap.dats;
Status : abap.char(1);

Step 2: Define Behavior (BDEF)

define behavior for ZI_PurchaseOrder

create;

update;

delete;

action approve;

Step 3: Implement Behavior (BIMP)

class ZCL_PurchaseOrder_BIMP definition

public final for behavior of ZI_PurchaseOrder.

method approve.

" Business logic for approving the purchase order

endmethod.

endclass.

Step 4: Expose Service

• Service Definition

define service ZI_PurchaseOrderService

expose ZI_PurchaseOrder;

• Service Binding:

OData V4 Protocol for UI consumption.


5. Advanced Features

Draft Capabilities:

Allows saving incomplete or temporary data before finalizing changes.

Late Numbering:

Generates keys only when data is saved.

Concurrency Control:

Manages simultaneous updates with ETags.

Authorization and Security:

Restricts access using SAP’s authorization framework.

6. Best Practices

• Use Managed Scenarios: Reduces the need for custom coding.

• Structure Your Code: Maintain clear separation of data, behavior, and service.

• Optimize CDS Views: Use associations and projections efficiently.

• Implement Error Handling: Provide meaningful messages and error feedback.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy