Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
pallab_haldar
Active Participant
Today, I am going to discuss about the generic data extraction using ABAP CDS view from S/4HANA to BW4HANA. Before That, let go though details of ABAP CDS view like what does it mean by ABAP CDS view , how it overcome some limitation of ABAP classic view ,commonly syntax, how it differs from HANA CDS view,what are the object that generated when you activated a CDS view , basic CDS view based extraction architecture , some important things to remember about ABAP CDS view.

Finally we will take a scenario where cross plant material description we will populate with material number in abap CDS and extract it in our BW/4HANA landscape. Let's go through one by one.

 

1. ABAP CDS view :


ABAP CDS is a view enable the base SQL view field with metadata i.e. data out the fields to make it more meaningful while  defining. ABAP CDS view is defined and maintained in the ABAP Netweaver Dictionary in the Application server levels. The field enrichment done using annotations.

There are three type of CDS view -

  1. @Analytics.dataCategory:#FACT

  2. @Analytics.dataCategory:#DIMENSION

  3. @Analytics.dataCategory:#CUBE


A sample common syntax of CDS view like this -
@AbapCatalog.sqlViewName: 'ZMMIMATPLANT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS Association DEMO'

define view ZMM_I_MAT_PLANT as select from MARA as m
association to MARC as _plant on
m.mara = _plant.mara
{
key matnr,
key werks,
_plant.sobsl,
_plant.mmsta
}
where _plant.sobsl='OH'

 

2. Object generated during CDS  DDL file (Source Code File) activation :



 

Note : 

  • The name of the CDS entity need to be defined after the DEFINE VIEW statement. The maximum length is 30 characters.

  • Recommended that the name of the DDL source file and the name of the CDS view are identical.

  • The name of the SQL View is specified after the Annotation @ABAPCatalog.sqlViewName.

  • Name of the SQL view file and the name of the CDS view must be different.

  • SQL view name permits the maximum length is 16 characters.


3. ABAP CDS view advantages over Classical ABAP Dictionary view :



  • Support Inner Join, Outer Join and Union. In the classical view inner join and selection only supported.

  • Calculation like aggregation,grupping is now possible with CDS view.

  • Construct nesting view is now possible in ABAP CDS view.


4. ABAP CDS view and HANA CDS view Comparison :


ABAP CDS views are database independent and maintain by ABAP dictionary and hence can be consumed in ABAP Programs.

HANA CDS views is database dependent and used in native SAP HANA applications.They can only be used with a HANA database and database dependent. When HANA CDS view deployed it create HANA table in associated Database tenant.

5. Templates used frequently to create CDS view:  I prefer to use the define template to create ABAP CDS views and then expand from there as per the business scenario. For Nested logic implementation used Extend View.


 

5.  Annotation used in CDS views and functionality :

Below are some of the important annotation used in CDS views and find in the SAP help URL -

  1. AbapCatalog Annotations

  2. AccessControl Annotations

  3. ClientDependent Annotations

  4. DataAging Annotations

  5. EndUser Text Annotations

  6. Environment Annotations

  7. MappingRole Annotations

  8. Metadata Annotations

  9. Semantics Annotations


https://help.sap.com/doc/saphelp_nw751abap/7.51.0/en-US/63/0ce9b386b84e80bfade96779fbaeec/content.ht...

you can find from the below table also -
SELECT * FROM ABDOC_CDS_ANNOS where SPRAS = 'E'

7. CDS view based extraction architecture from S/4HANA to BW/4HANA:

To understand the below architectural diagram we need to know the delta process which can be implemented using CDS view.

  • Generic Delta (without annotations and without using ODQs).

  • Annotations based delta using ODQs.

  • CDC based delta using SLT .


We will use 2nd type i.e Annotations based delta using ODQs so that we can use ODQMON for delta for the CDS view extraction.


Steps :

1. Create a CDS view in S/4 HANA side of data category Dimension using @Analytics.dataCategory:#DIMENSION. Sample code to follow is attached -
@AbapCatalog.sqlViewName: 'ZMMIMATPLANT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS Association DEMO'
@Analytics: {dataCategory: #DIMENSSION,
dataExtraction: {
enabled: true,
delta.byElement: {
name: 'LAEDA',
maxDelayInSeconds: 1800,
detectDeletedRecords: true
}
}
}

define view ZMM_I_MAT_PLANT as select from MARA as m
association to MARC as _plant on
m.mara = _plant.mara
{
key matnr,
key werks,
_plant.sobsl,
_plant.mmsta,
BRGEW
}
where _plant.sobsl='PH'

 

2. Create new source system of type ODP-ABAP CDS View.

3. go to RSA1 and application component and create new datasource. you can double click on the ODP-ABAP CDS View and create datasource which I used to do.


 

4. Provide the name of the SQL view and create the datasource.


5. Now the Datasource created using the CDS view created in S/4HANA and used this data source in approach 1 or approach 2.


 

6. Approach 1 : Model using traditional BI  objects like  ADSO  -

 


 

 

7. Approach 2 : Model using virtual modeling object lQuery CDs view Analytical CDS view    -


 

8. The same you can do by taking the standard CDS view  I_MATERIAL provided by SAP. You need to extend the view and apply association with other standard view. How you will search standard Interface view provided by SAP?

  1. SHIFT+CLTR+A  and search wit I

  2. In the ABAP CDS DDL after extends type I and then F2.


 

Hope this will help.

 

 

 
Labels in this area