Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
734 views

ABAP RESTful Application Programming Model (RAP) - Overview

SAP ABAP RAP

Uploaded by

Alexis Ramirez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
734 views

ABAP RESTful Application Programming Model (RAP) - Overview

SAP ABAP RAP

Uploaded by

Alexis Ramirez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

ABAP RESTful Application

Programming Model (RAP)


Overview
ABAP Product Management, SAP
May 2024
Public
Agenda

INTRODUCTION

BIG PICTURE

MAJOR CONCEPTS

SUMMARY

INTERNAL – SAP and Partners Only


Public 2
INTRODUCTION
ABAP Cloud

… is the ABAP development model to build cloud-ready


business apps, services or extensions

… compliant with clean core principles

… comes with SAP BTP and SAP S/4HANA

… works with public or private cloud, and even on-premise

INTERNAL – SAP and Partners Only


Public 4
The evolution to ABAP Cloud

2012 2015 2018 09/10.2022





ABAP Cloud

INTERNAL – SAP and Partners Only


Public * SAP Business Technology Platform 5
ABAP Cloud – What’s in?

DEVELOPMENT
MODEL
ABAP Cloud

REUSE SERVICES AND LIBRARIES

TRANSACTIONAL BUILT-IN QUALITIES

ANALYTICAL LIFECYCLE MANAGEMENT

INTEGRATION TOOLS

DEVELOPMENT SCENARIOS CONTAINING

INTERNAL – SAP and Partners Only


Public 6
ABAP Cloud map

SAP FIORI APPS


APP
ANALYTICAL APPS

Git based transport management with gCTS and abapGit


Cloud-readiness, IAM4, BC5, extensibility, security, ...
REUSE SERVICES AND LIBRARIES
BUSINESS UI SERVICES INTEGRATION SERVICES

key user & monitoring tools


LIFECYCLE MANAGEMENT
SERVICE for SAP Fiori and analytical clients for process and data integration

Output management, jobs., XCO, ...


EXPOSURE (OData, business events, HTTP, SOAP, RFC, SQL)

BUILT-IN QUALITIES
(OData and InA1)

TOOLS
DOMAIN-SPECIFIC MODELS
CDS2 entity, RAP3 Business Object, CDS analytical provider
DOMAIN-SPECIFIC
IMPLEMENTATION

BAS7,
DOMAIN-SPECIFIC LOGIC

ADT6,
ABAP, CDS

BUSINESS INTEGRATION SERVICES


DATABASE SAP HANA SERVICE for process and data integration
(OData, business events, HTTP, SOAP,
(SQL and SQLScript) CONSUMPTION RFC, SQL)

1 Information access 3 ABAP RESTful application programming model 5 Business Configuration 7 Business Application Studio
INTERNAL – SAP and Partners Only
Public 7
2 Core Data Services 4 Identity& Access Management 6 ABAP Development Tools
ABAP Cloud – IDE and API examples for on-stack developer extensibility

Custom ABAP on
SAP S/4HANA Cloud
ABAP development tools in Eclipse
Cloud-optimized ABAP language
Proven ABAP transport management

Access to public SAP APIs ONLY


– otherwise, syntax error!
No access to old Dynpro APIs
No direct select on SAP table MARA

Local APIs from SAP S/4HANA


SELECT products from
SAP S/4HANA tables using the public
I_Product CDS view

INTERNAL – SAP and Partners Only


Public 8
ABAP Cloud – One development model for SAP S/4HANA and SAP BTP

SAP S/4HANA SAP S/4HANA Cloud SAP S/4HANA Cloud SAP BTP,
any premise 1 Private Edition 1 Public Edition 2 ABAP Environment

ABAP Cloud development model


to build cloud-ready business apps, services, and extensions

Classic ABAP development model

1 SAP S/4HANA any premise or SAP S/4HANA Cloud Private Edition release ≥ 2022
2 SAP S/4HANA Cloud Public Edition release ≥ 2208, 3-system landscape required

INTERNAL – SAP and Partners Only


Public 9
KEY PLAYERS
The key players in RAP

ABAP DEVELOPMENT TOOLS IN ECLIPSE for all development tasks


Easy developer onboarding
End-to-end development flow

LANGUAGES: ABAP AND CORE DATA SERVICES (CDS)


Standard implementation tasks via typed APIs supporting
static code checks, auto-completion, element info

POWERFUL FRAMEWORKS
Take over technical implementation tasks
Business logic added in code exits on protocol-agnostic layers

INTERNAL – SAP and Partners Only


Public 11
Efficient ABAP development for Eclipse

HIGH DEVELOPER PRODUCTIVITY ON-PREMISE AND IN THE CLOUD

MODERN DEVELOPMENT TOOLSET


Fully eclipse-based
Syntax check, code completion
Navigation, search, quick fixes
Full support for the ABAP RESTful
Application Programming Model and CDS

QUALITY ASSURANCE
Static code checks (ATC, CVA) with
remote and local scenarios
Unit testing incl. isolation frameworks
Test seams and injections

SUPPORTABILITY
Debugging, profiling, tracing
Static and dynamic logging
Runtime monitoring and analysis

INTERNAL – SAP and Partners Only


Public 12
Declarative and expression-oriented ABAP language

Entity Manipulation Language (EML) to control the


Simple and concise ABAP code through new language
transactional business object behavior in the RAP context
features such as inline declarations, constructor expressions
and raising RAP events

Extensively expression-oriented syntax JSON support in sXML library

Advanced table operations such as CORRESPONDING( ) Inline code documentation with ABAP Doc, Development
operator, grouping, and filtering object documentation with knowledge transfer objects

Cloud-optimized ABAP language version available for


Unit testing with ABAP Unit using test doubles and test seams
cloud-ready development in the cloud and on-premise

More information in the ABAP Keyword Documentation

INTERNAL – SAP and Partners Only


Public 13
The Entity Manipulation Language (EML) at a glance

Entity Manipulation Language

EXTENSION OF THE ABAP LANGUAGE CONTROL THE TRANSACTIONAL BO


with an SQL-like syntax BEHAVIOR IN RAP CONTEXT

DATA CONSISTENCY ENSURED BY DATABASE LUW


DIRECT API-BASED ACCESS TO RAP BOs
COMMIT operation required to persist changes

STANDARD EML API GENERIC EML API


for type-safe read and modifying access to RAP BOs generic framework integration of RAP BOs

INTERNAL – SAP and Partners Only


Public
More information in this blog post 14
Next generation data modeling and access with ABAP CDS

COMMON DATA MODEL

Semantically rich
Declarative

ABAP
Close to conceptual thinking

IMPROVED PROGRAMMING MODEL


CORE For all application domains

DATA
Rich set of built-in functions
Code pushdown capabilities
Declarative access control

SERVICES CAPTURE BUSINESS INTENT


Reduced complexity
Extending SQL

Learn more about ABAP CDS


INTERNAL – SAP and Partners Only
Public 15
Overview of supported ABAP CDS entity types1
Category ABAP CDS Entity Type ABAP CDS Statement

Standard view building CDS View Entity DEFINE VIEW ENTITY


CDS Projection View DEFINE VIEW ENTITY AS PROJECTION ON
CDS Projection View – Analytical Query DEFINE TRANSIENT VIEW ENTITY AS PROJECTION ON
CDS DDIC-based View (deprecated) DEFINE VIEW (deprecated)

Advanced view building – External implementation CDS Custom Entity DEFINE CUSTOM ENTITY
CDS Abstract Entity DEFINE ABSTRACT ENTITY

Advanced view building – SAP HANA breakout CDS Table Function DEFINE TABLE FUNCTION
CDS Hierarchy DEFINE HIERARCHY
2
CDS Scalar Function DEFINE SCALAR FUNCTION

2
Type definition CDS Simple Type DEFINE SIMPLE TYPE
2
CDS Enumerated Type DEFINE TYPE ENUM

Transactional behavior definition of business objects built CDS Behavior Definition (and Projection) DEFINE BEHAVIOR
with the ABAP RESTful Application Programming Model

Modification-free extension CDS View Entity Extension EXTEND VIEW ENTITY


CDS Custom Entity Extension EXTEND CUSTOM ENTITY
CDS Abstract Entity Extension EXTEND ABSTRACT ENTITY
CDS DDIC-based View Extension (deprecated) EXTEND VIEW (deprecated)
CDS Metadata Extension ANNOTATE VIEW
CDS Behavior Extension EXTEND BEHAVIOR

Access control definition CDS Access Control DEFINE ROLE

INTERNAL – SAP and Partners Only


Public 1 Status from Q2/2024 | 2 Available on-prem starting with Release 2023 16
Next generation data modeling and access with ABAP CDS – Example
View annotations

View definition Data source

Associations

Element annotations

Selection

ABAP Flight Reference Scenario -


Example available in package /DMO/FLIGHT_DRAFT

INTERNAL – SAP and Partners Only


Public 17
BIG PICTURE
Evolution of the ABAP programming model

ABAP PLATFORM ≤ 7.5 ABAP PLATFORM ≥ 7.5 SAP BTP


ABAP ENVIRONMENT
SAP S/4HANA CLOUD
SAP S/4HANA ≥ 1909

CLASSIC ABAP ABAP PROGRAMMING ABAP RESTful


PROGRAMMING MODEL FOR APPLICATION
SAP FIORI PROGRAMMING
MODEL (RAP)

CDS, CDS-based BOPF, SEGW


Best practice freestyle ABAP / @OData annotation with CDS, Behavior Definition &
programming, (Web) Dynpro, Referenced Data Source, Implementation, Business
CDS1 SAP Fiori, SAPUI5 Services, SAP Fiori, SAPUI5
1 starting with release 7.4 SPS 05

Safe investments!

INTERNAL – SAP and Partners Only


Public 19
ABAP RESTful Application Programming Model (RAP)

SAP Fiori UI services


RAP – FOR EFFICIENT ENTERPRISE
Web APIs and local APIs
GRADE APPLICATION DEVELOPMENT
Events

CONCEPTS SERVICE DEVELOPMENT

TOOLS
Greenfield development

LANGUAGES Brownfield development

FRAMEWORKS UNIVERSALLY USABLE PROGRAMMING MODEL

BEST PRACTISES SAP BTP ABAP Environment

SAP S/4HANA, cloud and on-premise editions

AVAILABLE IN THE CLOUD AND ON-PREMISE

INTERNAL – SAP and Partners Only


Public 20
ABAP RESTful Application Programming Model (RAP) – The big picture

APP SAP FIORI APPS

UI SERVICES INTEGRATION SERVICES


for SAP Fiori and analytical clients for process and data integration
BUSINESS (OData) (OData based Web API, business events)
SERVICE
EXPOSURE
SERVICE BINDING
Service Definition, Service Projection, Event Binding

DOMAIN-SPECIFIC MODELS
CDS1 entity, RAP2 Business Object
DOMAIN-SPECIFIC
IMPLEMENTATION
DOMAIN-SPECIFIC LOGIC
ABAP, CDS

1 Core Data Services


DATABASE SAP HANA
2 ABAP RESTful application
(SQL and SQLScript) programming model

INTERNAL – SAP and Partners Only


Public 21
MAJOR CONCEPTS
Business object

BUSINESS OBJECT

DATA MODEL BEHAVIOUR RUNTIME IMPLEMENTATION

CDS: data modeling BDEF: behavior definition ABAP: Behavior implementation

COMPOSITION TREE CRUD,


root, actions, functions,
parent, and locks, eTag, authorizations,
child nodes feature control, draft

INTERNAL – SAP and Partners Only


Public 23
Business object runtime implementation types

INTERACTION SAVE
UNMANAGED
PHASE SEQUENCE
For brownfield developments with available application code for
interaction phase, transactional buffer, and save sequence
finalize
➔ Developers in charge of BO runtime: CRUD operations
check_before_save ➔ Adapters needed to integrate the existing code
MODIFY

adjust_numbers
LOCK
READ

save
MANAGED
For greenfield developments with standard implementation
(opt. unmanaged application components: e.g., DB tables, lock/PFCG objects,
Transactional
buffer update task function modules)
➔ Standard CRUD operations work out of the box
SAP HANA
➔ Developers add BO specific business logic
BUSINESS OBJECT (BO) RUNTIME

INTERNAL – SAP and Partners Only


Public 24
Business service

BUSINESS SERVICE

SERVICE SCOPE SERVICE BINDING WEB API LIFECYCLE TOOL SUPPORT

Service Definition: which entities? Protocol: Release UI Scenarios:


OData V2, OData V4, InA, SQL SAP Fiori elements preview

BO Projection View: which elements? Versioning

Scenario: Web API:


Behavior Projection: which behavior? Web API, UI, Analytics, … Deprecation Swagger UI preview *

* planned

INTERNAL – SAP and Partners Only


Public 25
SAP Fiori UI and Web API consumption

SAP FIORI UI Web API

UI annotation exposure Required Not applicable

Value help Required Not applicable

Dynamic feature control Required Not applicable

Draft Required Not applicable

Content IDs for complex


Not applicable Required
$batch requests

Release, versioning, and


Not applicable Required
deprecation

INTERNAL – SAP and Partners Only


Public 26
Development flow
DEFINE ROLES SERVICE ADT wizard available for the generation
Role PREVIEW of all required RAP artifacts of a service
BINDING based on a database table

BIND TO SCENARIO
AND PROTOCOL

SERVICE
DEFINITION
AUNIT
Scenario and integration test
DEFINE SCOPE

DATA MODEL BEHAVIOR AUNIT


PROJECTION ADD PROJECTION Unit test
BEHAVIOR

PROJECT ELEMENTS
AND ENRICH PROJECT BEHAVIOR

CDS BASED CDS BEHAVIOR


Authority object CDS role ABAP CODE
QUERY DATA MODEL ADD DEFINITION IMPLEMENT
DATA ACCESS BEHAVIOR BEHAVIOR
CONTROL

AUTHORITY-CHECK

Lock object
APPLICATION DATA
DATABASE TABLES

INTERNAL – SAP and Partners Only


Public 27
DRAFT HANDLING
Draft handling – RESTful architecture and draft

ENABLERS FOR CLOUD AND MODERN UX

Cloud environment expects high availability, continuous delivery, and low TCO
RESTful avoids problematic server stickiness by introducing a stateless communication
Draft fills the gap between stateless communication and stateful application

Modern user experience requires multi device support and data loss prevention without
connection timeouts
Draft persists the state device independently in a non-process-relevant way
RESTful makes the draft available as an addressable resource

Guiding principle
Draft is the persisted transactional buffer as an addressable resource

INTERNAL – SAP and Partners Only


Public 31
Draft handling – stateful applications with stateless communication protocol

Stateless transactional apps (without draft) Draft-enabled apps


EDIT SAVE EDIT SAVE SAVE SAVE ALL

Perceived Perceived
transaction transaction
IMPACT

Back-end Back-end
execution execution

IMPACT IMPACT
for end users for end users

No feedback (such as messages, feature control) Early feedback comes from calculations and validations in
until SAVE is triggered the back end, including feature control
Draft automatically supports data loss prevention, continuous
work, and device switch

INTERNAL – SAP and Partners Only


Public 32
EXTENSIBILITY
RAP extensibility options

SERVICE BINDING

SERVICE DEFINITION
Modification-free extension of RAP BOs

EXTENSION
SERVICE PROJECTION
and business services

EXTENSION
RAP BO INTERFACE
BUSINESS BO projection view BO projection view RAP extension points possible for …
SERVICE Behavior projection Behavior projection
EXPOSURE ❖ Data model extension
❖ BO behavior extension
❖ BO node extension

RAP BUSINESS OBJECT ❖ Service definition extension

EXTENSION
Data model Exposed in RAP based UI services and
Behavior definition
Web APIs
DOMAIN-SPECIFIC
Learn more in the RAP Extensibility Guide
IMPLEMENTATION

DATA SAP HANA


ACCESS database, stored procedures and functions, etc.

INTERNAL – SAP and Partners Only


Public 34
TESTABILITY
Testability options

AVAILABLE TODAY
Service Tests ➢ ABAP TDF
SERVICE BINDING
AUNIT & LOCAL CLIENT PROXY
➢ CDS TDF
SERVICE DEFINITION ➢ ABAP SQL TDF
➢ Function Modules TDF
SERVICE PROJECTION ➢ RAP BO TDF (link)
CDS - BO projection view ➢ Authority Helper
BUSINESS BDEF - Behavior projection
➢ ABAP Test Seams
SERVICE ABAP - Behavior implementation
EXPOSURE BO Tests ➢ OData Local Client Proxy
AUNIT & ABAP / EML
➢ Test Relations
➢ OData V4 test class generator in
RAP BUSINESS OBJECT the cloud
CDS - Data model ➢ Official RAP Test Guide (link)
BDEF - Behavior definition
ABAP - Behavior implementation
Unit Tests
AUNIT & ABAP
DOMAIN-SPECIFIC PLANNED
IMPLEMENTATION ➢ BDEF test class generator

AUNIT: ABAP-Unit
TDF: Test Double Framework

INTERNAL – SAP and Partners Only


Public This presentation and SAP‘s strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. 36
TROUBLESHOOTING
ADT troubleshooting tools & browser developer tools

ADT ABAP RUNTIME GATEWAY ABAP DYNAMIC


ABAP DEBUGGER CDS TOOLS
FEED READER ERROR LOG ERROR LOG PROFILING LOGPOINTS *

ABAP CROSS
TRACE

BROWSER
DEVELOPER
TOOLS

Learn more about RAP troubleshooting tools


INTERNAL – SAP and Partners Only
Public *only on-premise 38
ADT troubleshooting tools for CDS

DATA PREVIEW

ANNOTATION
PROPAGATION

DICTIONARY
LOG

ACTIVATION ACTIVE
GRAPH ANNOTATIONS

Learn more about ABAP CDS tools


INTERNAL – SAP and Partners Only
Public 39
SUMMARY
Summary – key takeaways

ABAP Cloud is the development model provided to build cloud-ready enterprise services, apps, and extensions on
SAP BTP ABAP environment and all editions1 of SAP S/4HANA, in the cloud and on-premises
Development that is done with ABAP Cloud adheres to the clean core principles

The ABAP RESTful application programming model (RAP) is at the heart of ABAP Cloud for efficiently building
transactional OData-based services and SAP Fiori apps with built-in cloud qualities
RAP best support SAP HANA and SAP Fiori elements

RAP is available on SAP BTP ABAP Environment, SAP S/4HANA Cloud, and SAP S/4HANA as of edition 1909

The ABAP Cloud (incl. RAP) feature set is enhanced quarterly in SAP BTP ABAP environment, twice a year in
SAP S/4HANA Cloud Public Edition, and every two years in SAP S/4HANA Cloud Private Edition and SAP S/4HANA
See the ABAP Cloud Release Notes and the ABAP Cloud Roadmap Information

1 SAPS/4HANA any premise or SAP S/4HANA Cloud, private edition release ≥ 2022
SAP S/4HANA Cloud, public edition release ≥ 2208, 3-system landscape required

INTERNAL – SAP and Partners Only


Public 41
Sample implementations with the ABAP Flight Reference Scenario

Demonstrate how to use different


RAP capabilities concretely
Based on a simple to use and
understand data model: SFLIGHT
reloaded
Feature scope regularly enhanced
Downloadable from GitHub
Step-by-step description of scenarios
available in the RAP documentation as
development guides

Find more information in the RAP documentation: Cloud | SAP S/4HANA

INTERNAL – SAP and Partners Only


Public 42
SAP Fiori elements feature showcase app for RAP and ABAP CDS

Learn more about SAP Fiori elements Feature Showcase App with RAP

INTERNAL – SAP and Partners Only


Public 43
Become an ABAP Cloud certified developer
SAP Learning journeys valid for all SAP S/4HANA editions

👩‍🏫 SAP Learning Journey: Practicing Clean Core Extensibility for SAP S/4HANA Cloud
🥇 Become an SAP Certified Associate – ABAP Cloud Back-End Developer

INTERNAL – SAP and Partners Only


Public 44
Further information
ABAP Cloud Development Guide

ABAP RESTful Application Programming Model (RAP)


What’s New in ABAP RAP?
ABAP Roadmap Information | For ABAP-based Products and ABAP Cloud
SAP Fiori elements Feature Showcase App with RAP and ABAP CDS
Acquire Core ABAP Skills | Practicing Clean Core Extensibility for SAP S/4HANA Cloud | SAP Learning Journeys
ABAP Cloud sessions at SAP’s Devtoberfest in 2023 | ABAP Cloud sessions at SAP TechEd 2023
SAP BTP Developer’s Guide

Public SAP Web sites


ABAP Development Community: www.sap.com/community/topic/abap.html
SAP BTP ABAP Environment Community: https://community.sap.com/topics/btp-abap-environment
SAP S/4HANA Cloud ABAP Environment Community: https://community.sap.com/topics/s4hana-cloud-abap-environment
ABAP Testing and Analysis Community: https://community.sap.com/topics/abap-testing-analysis
SAP products: www.sap.com/products

SAP training and certification opportunities


www.sap.com/education – e.g. trainings S4D400, S4D430, S4D437, and HA400.
https://learning.sap.com/ – e.g., search for ABAP or ABAP Cloud
SAP Certified Associate – ABAP Cloud Back-End Developer

INTERNAL – SAP and Partners Only


Public 45
Important ABAP Cloud related guides

Overview, comparison of
How the old, tier 3 / classic ABAP How to check compliance
extensibility options, introduction How to leverage tier 2 of the
world maps to the new, tier 1 / with the ABAP Cloud and
to ABAP Cloud and 3-tier 3-tier extensibility model.
ABAP Cloud world. 3-tier extensibility model
extensibility model.

Further information and blog posts linked at https://community.sap.com/topics/s4hana-cloud-abap-environment and https://community.sap.com/topics/abap


INTERNAL – SAP and Partners Only
Public 46
Thank you.
Contact information:

© 2024 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material.

You might also like