Sei sulla pagina 1di 16

ABAP Core Data Services

No Pain, No Gain
Hitchhiker's Guide to ABAP CDS since NetWeaver 7.40

SAP Inside Track 2017, Frankfurt


Daniel Ridder @nielseabap
Whats CDS?
A beginners perspective
ABAP Core Data Services
Technical Description Context of Availability
Technologically agnostic definition of 1st introduction of CDS with NetWeaver 7.40
database views SP5 on AnyDB

CDS borrowed heavily from SQL-Standard Parameter-Views came up with 7.40 SP8
(DBMS compatibility unknown at that time)
Supports functions of ANSI-SQL
General availability of CDS for AnyDB (incl.
Parameter-Views) since NetWeaver 7.50
DDIC Object [DDLS] with can only be viewed
and edited with ADT
! DO NO MIX UP ABAP WITH HANA CDS !
Its a total different technology
Generates database native artefacts (DDL-
Statements) during activation
Whats the idea?
Accessing data
Programming model
Business Objects
Back to good software design

Data access via OpenSQL Business Objects


Performing with itabs Abstraction via API-Design
In the beginning the business object was created.
This has made a lot of people very angry and been widely regarded as a bad move.

Dont go back to the old days


Access via API
1st define your business
BOPF
SADL
object/data model
Make it accessible via API
OpenSQL

Business Object
Locking

Attributes
OpenSQL is still an API, but
Links to other
Business Objects
do not code logic into the
statement
Persistance use CDS Views instead
The truth lays inside the views
Consumption and Use-Cases
CDS may act as a read-only BO
Is the 1st choice for analytical No embedded BW in S/4HANA !
processes SAP BEx Query

Enables full code pushdown of


SAP BW
SAP BEx Tools
VirtualProvider

business logic to the database Function


Module

Business User

Can be consumed in different ways


Fiori App SAP Gateway


ABAP
ABAP CDS

OData via Annotation or SAP Gateway Floorplan Manager

BEx BW Tools

CDS phase of activation
There is a theory which states that if ever anyone discovers exactly what CDS
activation does, it will instantly disappear and be replaced by something even more
bizarre and inexplicable
Activation of a CDS Parameter-View
HDB on NetWeaver 7.50 SP3

There is no specification of SQL


database views supporting
parameters

Due to this a parameter view


becomes a complex native artifact

A function object with a table as a


result set has to be created

On HDB the definition of the


function is generated in SQLScript
Activation of a CDS Parameter-View
Oracle on NetWeaver 7.40 SP11

There is a theory which states that if ever anyone discovers exactly


what CDS activation does, it will instantly disappear and be replaced by
something even more bizarre and inexplicable.

- There is another theory which states


that this has already happened.
after activation on Oracle:
Here comes DB2 on zOS
Problem description DBMS- specific Lifecycle management
Extending/Modifying a database table during
SAINT yields to an upgrade error during Trans.
activation phase
Table
DROP TABLE "Z_DATATABLE
[IBM][CLI Driver][DB2] SQL0101N CDS View is too
The statement
error in DDL statement for "Z_DATATABLE long or too complex.
SQL-error "-478-[IBM][CLI Driver][DB2] ALTER, W. Parameters
DROP, OR REVOKE AFFECTING OBJECT TYPE FUNCTION
CANNOT BE PROCESSED BECAUSE OBJECT
SAPR3.Z_DATAVIEW OF TYPE FUNCTION IS DEPENDENT ON
IT" in DDL statement for "Z_DATATABLE"
--------------- DB-ROLLBACK() --------------- Trans.
<dependency>
error in DDL, nametab for "Z_DATATABLE" not
activated Table
Unhandled
dependencies between
native artifacts!
The walk of pain
Avoid ABAP CDS in an heterogeneous DBMS landscape
CDS on NetWeaver 7.40
The Walk of pain
Problems while upgrading to
NetWeaver 7.50:
undocumented change of CDS
specification (order of key attributes)

Development Track

Dec 2015 Jun 2016 Nov 2016

SAINT/SPAM breaks during activation phase Still 3x open incidents in system


SAINT/SPAM breaks during activation phase
incorrect order of activation upgrade process / SPAM breaks
incorrect order of activation
DB2/zOS
wrong quantity of activation
DB2
problems with cyclic dependencies
Upgrade-Performance
problems after renaming of views
SELECT * 2331160 - Renaming of CDS artifacts in
customer systems
https://launchpad.support.sap.com/#/notes/23
31160
Small selection of hitting notes
Note 2240326 - Cycle problems during activation of CDS views
cycles are subject to some restrictions No documentation at that time

Notes 2295005 - Data element change for table does not result in reactivation of all DDL sources during transport
2381956 - Inconsistent 'SELECT *' CDS views
2274996 - Problems with deletion of table or view fields with select * dependencies
Select-Star is for looser

Note 2239157 - Support of database features


Official GA of CDS Views with parameters in NetWeaver 7.50 on AnyDB What about the introduction in 7.40 SP8?

Note 2331160 - Renaming of CDS artifacts in customer systems


CDS Views could be renamed DDLS, CDS-Name, DDIC-Name (DDIC-Rename is always prohibited)

Note 2387971 - Incompatible ABAP changes from Release 7.40 to 7.50


Since NetWeaver 7.50 all key attributes must be located together at the start of SELECT
ABAP Core Data Services is a key technology

CDS goes further Recommendations using CDS


CDS let you define a VDM virtual data model Recommendations based on our experiences:
under S/4HANA (BO 1st) CDS > NetWeaver 7.40 > AnyDB
Do not built huge view hierarchies (< 5 level, not more
HDB supports the definition of ABAP CDS table than 10 views)
functions Do not use parameters!
Which solves a lack of AMDPs Avoid cycles in associations
Perform activation tests on each dbms target platform
CDS Test Double Framework
The upcoming S/4HANA programming model CDS > NetWeaver 7.50 > AnyDB
depends heavily on CDS Views We will see
The draft concept combines CDS and BOPF for
transactional Fiori-Applications and is triggered by CDS
annotations CDS > NetWeaver 7.50 > HANA
No restrictions

CDS > NetWeaver 7.51 S/4HANA


rocks
So Long, and Thanks for All the Fish
Daniel Ridder
@nielseabap

Potrebbero piacerti anche