0% found this document useful (0 votes)
226 views124 pages

01 PSD WEB 00003900 Webinar English

Uploaded by

polladas
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)
226 views124 pages

01 PSD WEB 00003900 Webinar English

Uploaded by

polladas
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/ 124

ABAP Cloud Partner

Certification Academy
Day 1
Tuesday, 20th February, 2024

INTERNAL – SAP and Partners Only


Questions & Answers

You can ask your questions

Using the Q&A panel (click on the Q&A button


in the lower part of the screen).

or

Raise your hand to ask verbally (click the raise


hand button) and we will unmute your line.

INTERNAL – SAP and Partners Only 2


Agenda

Session 1 (Today)
• 09:00am – 09:25am Introduction & Academy Overview
• 09:25am – 10:25am Introduction to Clean Core and ABAP Cloud
• 10:25am – 10:30am Break
• 10:30am – 12:00pm CDS Modelling
• 12:00pm – 12:30pm Q&A

Session 2
• 09:00am – 10:25am ABAP RESTful Programming Model
• 10:25am – 10:30am Break
• 10:30am – 11:30am ABAP RESTful Programming Model
• 11:30am – 11:35am Break
• 11:35am – 12:10pm 3-Tier Architecture
• 12:10pm – 12:30pm Q&A

Session 3
• 09:00am – 10:00am New Syntax and Concepts in ABAP
• 10:00am – 10:05am Break
• 10:05am – 11:05am Academy Summary & Certification Guidance
• 11:05am – 12:00pm Q&A

Q&A
• 09:00am – 11:00am FAQ and Q&A

INTERNAL – SAP and Partners Only 3


Introduction & Academy Overview
How does it work?

Here we are today


GET CERTIFIED
LIVE SESSIONS
Book and complete your
Join the live sessions with certification exam
our subject matter experts
Exercises in demo & ‘click-
through’ mode

ACADEMY ACADEMY
REGISTRATION COMPLETION
Completion of any Familiarize yourself with any
Academy pre- remaining content of the
requisites Learning Journey
Optionally join the “Ask the
Expert” session

INTERNAL – SAP and Partners Only 5


This is not a consulting hour, but a
preparation to certification exam.

INTERNAL – SAP and Partners Only


Next steps - Your learning path to become ABAP Cloud developer

Learning Journey: Go through Certification: ABAP Dev4S4C Badge


• Acquiring Core ABAP Skills Cloud
• Enablements/Wor
Practicing Clean Core Extensibility Hands-on
For SAP S/4HANA Cloud workshop
kshops

And as a support

ABAP Cloud Partner


Certification Academy
Delta Content

INTERNAL – SAP and Partners Only 7


ABAP Cloud Partner Certification Academy

• Acquiring Core ABAP Skills


• Practicing Clean Core Extensibility For SAP S/4HANA Cloud
Start Exercise

SAP Certified Associate - Back-End Developer -


ABAP Cloud

INTERNAL – SAP and Partners Only 9


ABAP Cloud – High-level abstraction model

BUSINESS UI SERVICES INTEGRATION SERVICES

Output Management, Jobs, SAP Workflow Mgmt, XCO,...

Git based code management with gCTS and abapGit


SERVICE OData and SAP Information Access (InA) OData, Events, HTTP, RFC, SQL
EXPOSURE for SAP Fiori and analytical clients for application and data integration

Cloud-readiness, IAM3, BC4, extensibility,...

ADT5, BAS6, Key User & Monitoring Tools


REUSE SERVICES AND LIBRARIES

LIFECYCLE MANAGEMENT
BUILT-IN QUALITIES
DOMAIN-SPECIFIC MODELS
CDS1 entity, RAP2 Business Object, CDS analytical provider

TOOLS
DOMAIN-SPECIFIC
IMPLEMENTATION
DOMAIN-SPECIFIC LOGIC
ABAP, CDS

BUSINESS INTEGRATION SERVICES


DATABASE SAP HANA SERVICE OData, SOAP, Events, HTTP, RFC
SQL and SQLScript CONSUMPTION for application integration

1 Core Data Services 3 Identity 5 ABAP


INTERNAL – SAP and Partners Only & Access Management Development Tools 10
2 ABAP RESTful application programming model 4 Business 6 SAP
Configuration Business Application Studio
ABAP Cloud Certification: Content

Question distribution:

Live demo

INTERNAL – SAP and Partners Only 11


Academy Content

Day 1
• Academy Overview
• Introduction to Clean Core and ABAP Cloud
• CDS modelling

Day 2
• Introduction to RAP
• 3-Tier-Architecture – concept, setup of
Software Components, access to Standard /
Custom Objects and Wrappers

Day 3
• New Syntax and Concepts in ABAP
• Summary & Certification Guidance

INTERNAL – SAP and Partners Only 12


How to practice ABAP Cloud?

System

You can use ABAP cloud in any BTP, ABAP


Environment (also free tier or trial environment)
as well as in every SAP S/4HANA release >2022

Examples
• Tutorials
• RAP Workshops (RAP100 etc.)
• Videos on Tutorials, e.g. from Devtoberfest (also
available in Youtube Playlist)
• Sessions on TechEd or ABAPConf

INTERNAL – SAP and Partners Only 13


Examples for further material to improve ABAP Cloud Skills

Clean Core introduction from TechEd (Youtube)

ABAP Cloud for classic ABAP developers from Devtoberfest (Youtube)

ABAP Cloud in action at ABAPConf (Youtube)

Tutorial on RAP basics (RAP100)

Tutorial on ABAP Cloud in SAP S/4HANA (OnlineShop-Example)

Tutorial on creating a Tier 2 Wrapper object

INTERNAL – SAP and Partners Only 14


The Clean Core Approach
ERP Challenges Today
Why do we need clean core?

Business New Landscape


Change Technologies Complexity
In today's fast-paced and ever- To succeed in the digital age, Companies must have a flexible
changing business environment, organizations need to embrace new infrastructure that allows them to
disruption across global supply capabilities. This includes quickly adapt their business
chains, customer preferences, and accelerating innovation, optimizing models as needed. This means
the workforce has become a and automating processes, and being able to rapidly adjust key
common occurrence. Businesses fostering agility in order to gain a applications to meet changing
must quickly adapt to these competitive edge. market demands and customer
changing requirements in order to needs.
remain relevant and thrive.

INTERNAL – SAP and Partners Only 16


Classic Extensibility: Classic custom ABAP code in on-premise

SAP ALL SAP OBJECTS CAN BE USED IN CUSTOM CODE


BUSINESS
SUITE

CLASSIC
SAP BUSINESS CUSTOM ABAP
SUITE SAP OBJECTS
APPLICATIONS DEVELOPMENT
CAN BE MODIFIED
Use and modify all
SAP objects

PRO
No restriction for extensions ✏︎ Extremely flexible and powerful

CON
There is no interface between SAP code and the extension
SAP software changes lead to high test and adaptation efforts
SAP NETWEAVER
✏︎ SAP upgrade effort increases and agility/innovation speed decreases

INTERNAL – SAP and Partners Only 17


Clean Core Concept
New rules for extensions to support smooth
SAP software updates
In the public cloud, SAP software updates run
automated and for all tenants in parallel
THERE IS NO CUSTOMER SPECIFIC UPGRADE PROJECT

RULE for No modifications to SAP objects allowed


Mandatory in
smooth software public cloud
updates
Recommended in
Extensions must be private cloud and
clearly separated Only stable public SAP APIs (local or remote) on-premise
from SAP code and SAP extension points can be used
Clean Core – Guiding Principles
Avoid extensions where not
necessary.
Avoid
Stay as close as possible to
SAP standard.

Leverage BTP as a platform to innovate Know your technical debts and


for additional differentiation.
Decouple
Clean Be Aware
evaluate them on a regular basis.

Automate with standard APIs and Events. Core Establish a binding governance
framework.

Extend and Integrate in a stable and


transparent manner. Cloud
Ready
Apply a zero-modification policy.
INTERNAL – SAP and Partners Only 20
Addressing clean core and the individual dimensions

Keep competitiveness
while reducing 1 Business processes
A clean core describes a system or a landscape of complexity.
systems that is as close to standard as possible
while running cloud-compliant extensions and Decouple extensions
integrations. from standard. 2 Extensibility

It allows you to adapt your system and system Control data according to
landscape to changing business requirements in latest standards. 3 Data

order to adopt new capabilities.


Keep the landscape
Strong governance is required for each technical reliable and flexible. 4 Integration
dimension of clean core.
Keep the operations
effective and efficient. 5 Operations

PUBLIC 21
Decouple extensions from standard

Keep competitiveness
while reducing 1 Business processes
complexity.
Main aspects
Decouple extensions
Avoid extensions when possible
from standard. 2 Extensibility
Set up a strong governance to create decoupled
extensions in a way that they would work in the cloud
(three-tier model) Control data according to
Separate extensions by leveraging released APIs – latest standards. 3 Data
custom extensions do not break an upgrade and
upgrades do not break an extension
Keep the landscape
Leverage the full capabilities of extensibility on the
stack as well as side by side with SAP BTP reliable and flexible. 4 Integration

Create technical debts only as informed decision

Keep the operations


effective and efficient. 5 Operations

PUBLIC 23
What makes extensions
clean core compliant? How to achieve
• Establish a governance model – a clearly defined process with high demands to approve any
extension.
What is a “good” extension? – Prefer standard over custom development by leveraging fit-to-standard best practices.
– Avoid custom code where possible. Don’t extend for rarely needed use cases.
– Prefer “clean” extension options over “unclean” ones.
Main aspects – Use SAP Application Extension Methodology and extensibility guidance to identify the best
path in your landscape.
• Avoid extensions when possible
• Set up a strong governance to create • If you need to extend, a clear separation is key.
decoupled extensions in a way that they – Only access standard objects through released and stable APIs (either remote or locally;
access for reading and changing access possible).
would work in the cloud (three-tier
model) – Choose only “clean” tools or environments and extensibility options (in SAP S/4HANA: key
user, developer, or side-by-side extensions).
• Separate extensions by leveraging
released APIs – custom extensions do • Choose extension domain based on requirements only.
not break an upgrade and upgrades do – SAP BTP automatically decouples extension but is not the only “clean” approach.
not break an extension* – Do not extend in the core simply because “we always do so.”
• Leverage the full capabilities of • Enable awareness.
extensibility on the stack as well as side – In on-premise installations, you can actively decide to develop some extensions not clean
by side with core, as long as they are documented and informed decisions (use cases: copy routines; API
SAP BTP not available, and more).
• Create technical debts only as – Mitigate missing APIs in private cloud or on premise by using wrappers as described in
informed decision ABAP Cloud API Enablement Guidelines for SAP S/4HANA Cloud, private edition, and
SAP S/4HANA.
*Ensuring upgrade stability can be a short-term workaround for
transforming a whole application from traditionally developed code into
– Create requests for APIs using a customer influence tool (for public or private cloud
cloud-compliant (Tier 1) extensions. editions).

PUBLIC 24
Benefits of a Clean Core
Benefits of Clean Core
A clean core allows to adapt the system to changing
business requirements and to adopt new capabilities
while ensuring permanent traceability in all areas of the
core. It provides…
…agility
Benefits Clean environments decrease time to value. Additional process
requirements can be implemented faster and business models can
of Clean adapt to short term challenges more easily.

…ability to leverage latest innovations


Core Adaptation effort in the context of updates and upgrades is reduced.
Cloud services can be integrated faster.

…efficient and secure operations


E.g. no costly maintenance for unused artefacts

…data to value
Consistent data allows reliable forecasts and precise predictions.
INTERNAL – SAP and Partners Only 32
Relation of SAP S/4HANA transformations and clean core
# Deviation from clean core (= historically grown complexity)

Continue classically

A concrete clean core road


Brownfield or system conversion map can have many
Make the core clean – Keep the core clean expressions, depending on the
MAKE the core clean target architecture, the
organization’s strategic
direction, and more.

Greenfield or new implementation


Keep the core clean

SAP S/4HANA
SAP ERP Move to
Central Component SAP S/4HANA
Classic Extensibility Approaches &
Clean Core Extensibility
User Interface Layer Application Layer Database Layer

SAP S/4HANA extensibility


Core Solution Extensions Side-by-Side Extensions

Adopt new Developer


user interface Extensibility External access while shielding
backend systems
“clean”
Create custom
analytics High scale scenarios

Native/extended
Expose data
Secured mobile applications
SAP S/4HANA connectivity
SAP BTP
Key User
User Interface Event driven
Extensibility Core Solution Rules / Workflow Side-by-Side architectures
Create forms “clean”
/ email Extensibility Process / Events Extensibility
Process automation
templates Data Replication
“clean”
Multiple backends/Hub
Add scenarios
application
logic Multi-tenancy partner apps
Classic
Add database Extensibility1
fields / objects
“unclean”

INTERNAL – SAP and Customers Only 1 SAP S/4HANA on premise only; not “clean core”
36
SAP S/4HANA Cloud extensibility patterns
On-stack Side-by-side

New app

remote API
Remote API call, Side-by-side

Public
consume events
LOOSELY coupled
to SAP data, transaction, app

SAP BUILD
SAP S/4HANA New app
local API

Local API
Public

on stack SAP Build Apps


Cloud call,
SQL join TIGHTLY coupled SAP Build Process Automation
application such as to SAP data
SAP Build Work Zone

PRO-DEVELOPER TOOLS
Extend an
extension point

Extend SAP SAP Business Application Studio


code, data SAP app
Public

SAPUI5 / Fiori elements


structure,
TIGHTLY coupled CAP (Java, JS) ABAP Cloud
user
interface such as to an SAP SAP-Optimized Frameworks & Services
app or transaction

SAP Business
SAP S/4HANA Cloud Technology Platform
PUBLIC Loosely coupled Tightly coupled 37
Big Picture of Developing and Extending with ABAP Cloud

Automated Test in ABAP Cloud


Develop in ABAP Cloud Extend in ABAP Cloud
- CDS and Behavior implementation Unit test
- Read-only list reporting apps - Extensibility enablement
- EML and OData integration test
- Transactional Apps - CDS data model extension
- Managed/Unmanaged - Behavior extension
- Draft Application Deployment
- Node extension
- Multi-Inline Edit - SAP fiori application in ABAP Environment
- Key user extensibility
UI service with access to a remote service - SAP fiori application in Cloud Foundry
- - Custom Fields
- Analytical apps - Custom Logic
Identity and Access Management (IAM)
- Web APIs - Custom CDS Views and others
- IAM App, Business catalog **
Integration and Connectivity
Outbound communication with OData, HTTP, RFC, SOAP, MAIL
Lifecycle Management
Inbound communication with HTTP, RFC
- Software Components *

Business Object Capabilities - Import Collection *


Numbering, RAP Business events, Large objects (Attachment), Message mapping, etc - Transport mechanisms with
- Git-based CTS (gCTS)
Reuse Services and Objects
Change document solution, Application jobs, Application logs, XCO Library, etc - abapGit
- Cloud transport management (CTMS) *

* Only applicable for S/4HANA Public Cloud Edition


* Only applicable for SAP BTP, ABAP Environment
ABAP Cloud and RICEFW
ABAP Cloud Development Model
Cloud Principles

Cloud Computing Principles: Cloud Native Principles:


• Infrastructure independent
• Microservices
• Application Programming Interfaces

REST as a popular cloud native API architecture:

INTERNAL – SAP and Partners Only 48


ABAP Cloud
… is the ABAP development model to build cloud-ready business apps, services or extensions
… comes with SAP BTP and SAP S/4HANA
… works with public or private cloud, and even on-premise

INTERNAL – SAP and Partners Only 49


Evolution and Availability
The Evolution to ABAP Cloud

2012 2015 2018 09/10.2022

ABAP Cloud

INTERNAL – SAP and Partners Only * SAP Business Technology Platform 51


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

SAP S/4HANA SAP S/4HANA Cloud, SAP S/4HANA Cloud, SAP BTP,
any premise1 private edition1 public edition2 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

PUBLIC 52
Features of Cloud-Optimized ABAP
Language
Extensibility personas

Business expert,
Persona implementation consultant, Persona Developer
key user

Tools Low-code/no-code tools Tools Integrated development environment (IDE)

INTERNAL – SAP and Partners Only 55


Features of Cloud-Optimized ABAP Language

INTERNAL – SAP and Partners Only 56


ABAP RESTful Application Programming Model
Transactional (OLTP) Aspects

INTERNAL – SAP and Partners Only 57


From classic ABAP to ABAP Cloud

INTERNAL – SAP and Partners Only 58


ABAP Development Tools for Eclipse
ABAP Development Tools for Eclipse (ADT)
Documentation

Code

Wizards & Tools


Generators

INTERNAL – SAP and Partners Only 62


ABAP Development Tools for Eclipse: IDE and API examples

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 the MARA table
from SAP

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 63


Exploring Released APIs
Exploring Released APIs
How to identify APIs for SAP S/4HANA

1. Discover 2. Dive into the 3. Look for 4. Utilize 5. Request


APIs on SAP released successor repository of APIs for
Business objects in objects in released public /
Accelerator your system your system objects private cloud
Hub Property filter:
USE_IN_CLOUD_D Property filter:
EVELOPMENT HAS_CLOUD_DVLP
MNT_SUCCESSOR

INTERNAL – SAP and Partners Only 66


CDS Modeling
CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 72


ABAP RESTful Programming Model: Overview

INTERNAL – SAP and Partners Only 74


CDS View in the context of the RAP Business Service

CDS
View

Service Definition

Service Binding

INTERNAL – SAP and Partners Only 75


Demo: How to create a CDS View based upon a Database Table
@EndUserText.label : 'Promotion Header Data'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #ALLOWED
define table zmupm_promo_hdr {

key client : abap.clnt not null;


key promotion_id : zmupm_promotion_id not null;
promotion_description : zmupm_promotion_description;
startdate : datn;
enddate : datn;
location_id : zmupm_location_id;
approval_status : abap.char(1);
createdat : timestampl;
createdby : syuname;
changedat : timestampl;
changedby : syuname;

}
INTERNAL – SAP and Partners Only 76
Demo
How to create a CDS View based upon a Database Table
Demo system: H01 (BTP ABAP Environment)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 77


ABAP RESTful Programming Model: What is a Business Service?

Lifecycle
Service Binding
Protocol: Release
• OData V2/V4 Versioning
• InA Information Access
• SQL Access Deprecation

Scenario:
• Web API
• UI
2
3
1 Tool support
4 UI: SAP Fiori Elements preview

Service Model Web API: Swagger UI preview


R

Entities to be exposed via


service definition

INTERNAL – SAP and Partners Only 78


ABAP RESTful Programming Model: What is a business object (BO)?

Behaviour
CRUD, Actions,
Locks, eTag Authorizations,
Feature Control,
Data Model Draft

R
2

1 3
Runtime Implementation

INTERACTION PHASE

TX buffer

SAVE SEQUENCE

INTERNAL – SAP and Partners Only 79


ABAP RESTful Programming Model:
Business Objects > Data modeling with CDS
Name of the CDS View Entity
BUSINESS OBJECTS
Data modeling with CDS

Behavior definition

Behavior implementation

Development
Object

The data of an application is distributed across several database tables. Using ABAP CDS views, you can rearrange the
table fields according to application-specific needs from the ABAP source code of your implementation
A CDS view entity is defined for existing database tables and views, or for other CDS views in the ABAP Dictionary

INTERNAL – SAP and Partners Only 80


ABAP RESTful Programming Model:
Business Objects > Data modeling with CDS – Associations

Associations
An association defines a structural and unidirectional relationship between two CDS views
Associations are used to navigate from a source CDS view to a related target CDS view

cardinality projection

INTERNAL – SAP and Partners Only 81


ABAP RESTful Programming Model:
Business Objects > Data modeling with CDS - Structure

BO structure = hierarchical tree of


nodes

Root entity represents the entire


BO

Nodes are linked by compositions


(=special kinds of associations)
by

A composite part only exists


together with its parent entity
(whole)

INTERNAL – SAP and Partners Only 82


ABAP RESTful Programming Model:
Business Objects > Data modeling with CDS – Compositions

parent entity

COMPOSITION
To define a composition relationship from the
parent to a child entity

child entity

child entity

every composition relationship requires an


association to their compositional parent entity

parent entity

INTERNAL – SAP and Partners Only 83


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 84


Classification of SAP Annotations

INTERNAL – SAP and Partners Only 85


Important ABAP Annotations for CDS View Entities

INTERNAL – SAP and Partners Only 86


ABAP Annotations for View Elements

INTERNAL – SAP and Partners Only 87


Grouping of Annotations

INTERNAL – SAP and Partners Only 89


ABAP Annotations for Translatable Texts

INTERNAL – SAP and Partners Only 91


Translation of Annotations

INTERNAL – SAP and Partners Only 92


Translation of Annotations in SAP BTP, ABAP Environment “Steampunk”

INTERNAL – SAP and Partners Only 94


Demo
How to translate CDS annotations
Demo system: H01 (BTP ABAP Environment)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 95


Active Annotations View

INTERNAL – SAP and Partners Only 96


View on View - Motivation

INTERNAL – SAP and Partners Only 97


Propagated Annotations

• If a CDS view entity reads from another


view entity, it can inherit metadata from the
source view

• This is called annotation propagation

• Propagation is restricted to element


annotations. Entity and view annotations
never get propagated

INTERNAL – SAP and Partners Only 98


Ignore Propagated Annotations

INTERNAL – SAP and Partners Only 99


Demo
Define a view on a view
Demo system: H01 (BTP ABAP Environment)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 100
CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 101


Relationships in ABAP Dictionary and ABAP CDS

ABAP CDS and ABAP Dictionary use different


concepts to express relationships:

Associations
ABAP CDS uses Associations to define relationships
between CDS view entities.

Usually, one relationship is reflected by two associations,


pointing in opposite directions.

Foreign Keys
ABAP Dictionary defines a dependency for table fields to
establish a relationship to another database table.

One such foreign key dependency corresponds to one


relationship.

INTERNAL – SAP and Partners Only 102


Associations in CDS Views

• Associations are more flexible


than foreign key
dependencies

• Two associations between the


CDS entities

• One foreign key dependency


between two database tables

INTERNAL – SAP and Partners Only 103


Association - The Syntax

Association Parts

• Association Target
• Association Name
• Association Condition

INTERNAL – SAP and Partners Only 104


Cardinality of Associations

Cardinality
number of possible data sets in the
association target for one data set in
the association source

INTERNAL – SAP and Partners Only 105


Exposed Associations

• Exposed = add association


to the element list

• Association is then visible for


consumer

INTERNAL – SAP and Partners Only 106


Exposed Associations in Data Preview

Evaluate these associations in the Data Preview tool

INTERNAL – SAP and Partners Only 107


Compositions
Composition: Specialized
association that has a whole-part
relationship.

Composite part: Only exists


together with its parent entity.

Definition in CDS entities:


Keyword COMPOSITION OF

INTERNAL – SAP and Partners Only 108


Demo
How to Define and Expose an Association
Demo system: H01 (BTP ABAP Environment)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 109
CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks

2. SAP Annotations for CDS View Entities

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

8. Preventing unauthorized Access to Data

9. CDS View Extensions

INTERNAL – SAP and Partners Only 110


Using Exposed Associations

• Propagate associations

• Use associations (Path


Expression)

INTERNAL – SAP and Partners Only 111


Longer Path Expressions

Chain several associations

INTERNAL – SAP and Partners Only 114


Path Expressions in ABAP SQL

Association Prefix
• backslash (\).

Element Selector
• hyphen (-)

INTERNAL – SAP and Partners Only 116


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks

2. SAP Annotations for CDS View Entities

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

8. Preventing unauthorized Access to Data

9. CDS View Extensions

INTERNAL – SAP and Partners Only 117


Using Cast in CDS Views

INTERNAL – SAP and Partners Only 118


CASE Distinction in CDS Views

INTERNAL – SAP and Partners Only 119


Rules for Arithmetic Expressions in CDS Views

INTERNAL – SAP and Partners Only 120


Example Arithmetic Expressions in CDS Views

INTERNAL – SAP and Partners Only 121


Built-In Functions in CDS Views

INTERNAL – SAP and Partners Only 122


Examples: Built-In Functions in CDS Views

INTERNAL – SAP and Partners Only 123


Manipulating and Combining Result Sets

INTERNAL – SAP and Partners Only 124


Aggregations in CDS Views

INTERNAL – SAP and Partners Only 125


Joins in CDS Views

INTERNAL – SAP and Partners Only 126


Union (All) in CDS Views

INTERNAL – SAP and Partners Only 127


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 128


Input Parameters in CDS Views

INTERNAL – SAP and Partners Only 129


Input Parameter Declaration

INTERNAL – SAP and Partners Only 130


Access to Input Parameters

INTERNAL – SAP and Partners Only 131


Examples Input Parameters

INTERNAL – SAP and Partners Only 132


Input Parameters in View-on-View

INTERNAL – SAP and Partners Only 133


Supply CDS View with Input Parameters in ABAP SQL

INTERNAL – SAP and Partners Only 134


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 135


Access to ABAP System Fields Using CDS View Parameters

This mechanism only works when accessing the view from within ABAP.
In CDS and on database level, the parameters remain mandatory
parameters
INTERNAL – SAP and Partners Only 136
Values for @Environment.systemField Annotations

INTERNAL – SAP and Partners Only 137


Session Variables in CDS Views

INTERNAL – SAP and Partners Only 138


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 139


Authorization objects and authorization fields

INTERNAL – SAP and Partners Only 140


Repository Object Access Control

INTERNAL – SAP and Partners Only 141


Example CDS Access Control

INTERNAL – SAP and Partners Only 142


Examples: Simple Condition

INTERNAL – SAP and Partners Only 143


Examples: PFCG Conditions

INTERNAL – SAP and Partners Only 144


Access Control in the Data Definition Header

Details: See SAP Note


2725274

INTERNAL – SAP and Partners Only 145


CDS Modelling - Agenda

1. CDS Views as RAP Building Blocks 8. Preventing unauthorized Access to Data

2. SAP Annotations for CDS View Entities 9. CDS View Extensions

3. Associations between CDS View Entities

4. Path Expressions

5. Using Code Pushdown in CDS Views

6. Input Parameters

7. System Fields

INTERNAL – SAP and Partners Only 146


CDS View Extension

INTERNAL – SAP and Partners Only 147


Examples: CDS View and CDS View Extension

INTERNAL – SAP and Partners Only 148


Examples: CDS View Extension defines an Association

INTERNAL – SAP and Partners Only 149


Extensibility Controls for CDS Entities - 1

INTERNAL – SAP and Partners Only 150


Extensibility Controls for CDS Entities - 2

INTERNAL – SAP and Partners Only 151


Example: CDS View and Metadata Extension

INTERNAL – SAP and Partners Only 152


Metadata Extension Layers

INTERNAL – SAP and Partners Only 153


Learning Journey: Acquire Core ABAP Skills
This Learning Journey contains a section on CDS Modeling:

https://learning.sap.com/learning-journey/acquire-core-abap-skills

INTERNAL – SAP and Partners Only 154


Demo (optional)
Create a Metadata Extension
Demo system: H01 (BTP ABAP Environment)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 155

You might also like