You are on page 1of 40

Ram Niwas

ABAP RESTFUL APPLICATION


LinkedIn :-
PROGRAMMING
www.linkedin.com/in/ram-niwas-04
MODEL (RAP)
PART - 1

Introduction
( Evolution of the ABAP Programming Model )

SAP TECHNOMANIAC
Evolution of the ABAP Programming
Model

SAP TECHNOMANIAC
Classic ABAP Application
Programming
➢Most SAP customers are using
➢UI's Available :- Classic Dynpro, Web Dynpro ABAP,
Floorplan Manager
➢With the release 7.4 ABAP optimized for HANA
• CDS Introduced
• SAP Gateway became an integral part of the AS ABAP
• To enhance user experience UI5 + OData
• ADT Eclipse introduced

➢We are not part of front end development since


UI5 introduced

SAP TECHNOMANIAC
ABAP Programming Model for
SAP Fiori
➢We can build HANA optimized web-based
applications of all types, i.e., search, analytical
and transactional apps

➢To support transactional-based apps (CRUD


operation) we need to use BOPF

➢With ABAP 7.51 the draft capability

➢CDS UI annotations can develop Fiori apps without


any UI5 coding or less (Fiori elements)

SAP TECHNOMANIAC
Drawbacks

➢Difficult to integrate CDS + ODATA+ BOPF


➢Brownfield implementation not supported for CRUD
operation
➢We need to integrate the legacy code
➢We can't rebuild everything using BOPF
➢We don't want look at technical aspect too much . SAP want
us to focus on Business logic. Ex :- V2 -> V4
➢SAP also moving all APP from BOPF ->RAP
slowly if needed

SAP TECHNOMANIAC
ABAP RESTful Application
Programming Model
➢ RAP stands for ABAP RESTful
Application Programming Model.
➢ It's a programming model that defines
the architecture for developing OData
services in SAP BTP ABAP Environment
or Application Server ABAP.
➢ RAP uses the SAP HANA database to
persist application data.

SAP TECHNOMANIAC
ABAP RESTful Application
Programming Model
➢Integrate the different concepts into the ABAP and
CDS languages

➢It is generally available in the SAP BTP ABAP Environment

➢It is available from SAP S/4HANA on-premises 1909 edition

➢RAP is the only recommended programming


model in SAP S/4HANA on-premise as of edition
2021 and SAP BTP ABAP environment.
SAP TECHNOMANIAC
ABAP RESTful Application
Programming Model
RAP is based on proven and modern technologies and concepts. These include:
➢Core Data Services (CDS)
➢The modernized and extended ABAP Language used to implement the
business logic
➢The OData protocol used for stateless communication
➢The concept of Business Objects used for building transactional applications
➢The concept of Draft used for building stateful applications
with stateless technologies
➢The concept of Business Services used to create
OData-, InA-, and SQL-based services

SAP TECHNOMANIAC
The key players in the ABAP
RESTful Application Programming
Model are:

SAP TECHNOMANIAC
Ram Niwas
ABAP RESTFUL APPLICATION
LinkedIn :-
PROGRAMMING
www.linkedin.com/in/ram-niwas-04
MODEL (RAP)
PART - 2

RAP Architecture Overview


( Business object and Compositions )

SAP TECHNOMANIAC
Big Picture-Architecture Overview

SAP TECHNOMANIAC
DATA MODELING & BEHAVIOR
➢It deals with data and the corresponding business logic.
➢The RAP uses CDS to define and organize the data model.
• CDS provides a framework for defining and consuming semantic data
models
• CDS entities are the fundamental building blocks for your application
➢Data models support access to database
• Transactional access ( Uses Business Object)
• Query access ( Uses Queries)

SAP TECHNOMANIAC
DATA Model
• The blue boxes represent a
Travel business object with its
child entities Booking and
Booking Supplement
• The white boxes represent the
entities that are not part of
the business object, but
support with value helps or
text associations.

SAP TECHNOMANIAC
Business Object
➢A business object (BO) is a common term to represent
a real-world artifact in enterprise application
development such as the Travel, Sales order
➢It have several nodes
• The Travel => Booking => Booking Supplements
• The Sales Order => Sales Item => Schedule Lines
➢It have Common Transactional operation
• Create
• Update
• Delete
• Actions

SAP TECHNOMANIAC
A Business Object is
characterized by

➢a structure,
➢a behavior and
➢the corresponding runtime implementation.

SAP TECHNOMANIAC
Business Object

BO is characterized by
➢A structure
➢A behavior and
➢The corresponding
runtime
implementation.

SAP TECHNOMANIAC
BO is characterized by A
structure
➢ BO consists of a
hierarchical tree of nodes
(Sales Order, Items,
Schedule Lines)
➢ Nodes are linked by special
kinds of associations,
namely by compositions.

SAP TECHNOMANIAC
Association vs Composition
➢Association and composition are two types of
relationships between entities in CDS.
• Association is a general relationship between two
entities. It can be one-to-one, one-to-many, or many-
to-many.

SAP TECHNOMANIAC
Association vs Composition
➢Association and composition are two types of relationships
between entities in CDS.
• Composition is a stronger type of relationship between two
entities. It represents a whole-part relationship, where the child
entity cannot exist without the parent entity.

SAP TECHNOMANIAC
Key differences
Feature Association Composition
Strength of
Weak Strong
relationship
Can the child
entity exist
Yes No
without the parent
entity?

Can the child


entity be deleted
Yes No
independently of
the parent entity?

Can be one-to-
Cardinality one, one-to-many, Typically one-to-many
or many-to-many

SAP TECHNOMANIAC
BO is characterized by A
structure
➢ Composition Tree.
➢ Root entity
➢ Child entity

SAP TECHNOMANIAC
Root Entity

➢Root node defines the top node within a hierarchy in a


business object's structure
➢The root entity serves as a representation of the
business object

SAP TECHNOMANIAC
Child and Leaf Entity
➢A to-parent association in ABAP CDS is a specialized
association which can be defined to model the child
parent relationship between two CDS entities.

➢Leaf entity - if it represents a node in a business


object's structure without any child nodes.

SAP TECHNOMANIAC
Ram Niwas
ABAP RESTFUL APPLICATION
LinkedIn :-
PROGRAMMING
www.linkedin.com/in/ram-niwas-04
MODEL (RAP)
PART - 3

RAP Architecture Overview


( Business object Behavior & The
corresponding runtime implementation )

SAP TECHNOMANIAC
Big Picture-Architecture Overview

SAP TECHNOMANIAC
Business Object

BO is characterized by
➢A structure
➢A behavior and
➢The corresponding
runtime
implementation.

SAP TECHNOMANIAC
Behavior of a Business Object
➢ Behaviour definition is an ABAP
Repository object that describes the
behavior of a business object.
➢ A behavior definition is defined
CDS Model
using the Behavior Definition
Language (BDL).
➢ The implementation of a behavior
definition can be done in a single
ABAP class (behavior pool) or can
be split between an arbitrary set of
ABAP classes.

Relationship Between the CDS Entities and the


Business Object Behavior
SAP TECHNOMANIAC
Business Object’s Behavior
➢ A behavior specifies the
• Operations
• Field properties

➢ It includes for each entity of the


business object’s composition tree.
• A behavior characteristic
• A set of operations

SAP TECHNOMANIAC
Business Object’s Behavior
Operations
➢ Modify operations :-
• CUD
• Action

➢ Read operations
• Read
• Read By Operation
• Function

SAP TECHNOMANIAC
Business Object’s Behavior
Behavior Characteristic
➢ ETag

➢ Draft handling

➢ Feature control

➢ Numbering

➢ Authorization Control

SAP TECHNOMANIAC
Business Object

BO is characterized by
➢A structure
➢A behavior and
➢The corresponding
runtime
implementation.

SAP TECHNOMANIAC
Behavior Defination

SAP TECHNOMANIAC
Business Object’s Runtime
➢The business object runtime
mainly consists of two parts:
• Interaction phase
• Save sequence

SAP TECHNOMANIAC
Business Object

BO is characterized by
➢A structure
➢A behavior and
➢The corresponding
runtime
implementation.

SAP TECHNOMANIAC
Big Picture-Architecture Overview

SAP TECHNOMANIAC
THANK YOU
CONTACT
Ram Niwas

LinkedIn :- https://www.linkedin.com/in/ram-niwas-04/

FB group :-
https://www.facebook.com/groups/586730659057346/

SLIDE /
SAP TECHNOMANIAC
External and Internal
Perspective of Business Objects
➢External perspective :- Focuses on the features and
functionality of the business object that are important
to customers, partners, and other external
stakeholders.
➢Internal perspective :- Focuses on the implementation
details of the business object, such as its data
structure, behavior, and relationships with other
business objects.

SAP TECHNOMANIAC
Flight Tables and Relationship

SAP TECHNOMANIAC
Data Model we want create with CDS
The blue boxes represent
a Travel business object,
with its child entities
Booking and Booking
Supplement.

The white boxes represent


the entities that are not part
of the business object, but
support with value helps or
text associations

SAP TECHNOMANIAC
Behavior

➢Transactional scenarios :- the business object behavior


defines which operations and what characteristics
belong to a business object.

➢Read-only scenarios :- the behavior of the data model


is defined by the query capabilities, for example if the
data is filterable.

SAP TECHNOMANIAC

You might also like