Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member205436
Participant
94,159

The Challenge

With the availability of the SAP HANA platform there has been a paradigm shift in the way business applications are developed at SAP. The rule-of-thumb is simple: Do as much as you can in the database to get the best performance. This is also true for the underlying data models of the business applications.

Until now, data modeling in ABAP typically involved organizing your data in database tables/views and often providing some additional high-level services for the applications using suitable ABAP frameworks. It stands to reason that to enable real-time businesses some of these services should ideally also be brought closer to the data(base).

This presents several challenges. High quality data models should provide a single definition and format for the data. They should be clear and unambiguous, reusable and flexible, even extensible. So how can you capture the semantics of the data model in the database so that the model can be easily reused by different consumers, e.g. by OData clients and by OLAP tools? How can you extend the meta model to service your applications? Impossible, you say?  Maybe, if we didn't have Core Data Services (CDS).

The Solution

CDS simplifies and harmonizes the way you define and consume your data models, regardless of the consumption technology. Technically, it is an enhancement of SQL which provides you with a data definition language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. The enhancements include:

  • Annotations to enrich the data models with additional (domain specific) metadata
  • Associations on a conceptual level, replacing joins with simple path expressions in queries
  • Expressions used for calculations and queries in the data model

CDS entities and their metadata are extensible and optimally integrated into the ABAP Data Dictionary and the ABAP language.

CDS is supported natively in both the ABAP and the HANA Platforms! In fact, CDS is (in my opinion) the most ambitious and exciting SAP development in the area of data modeling in recent years. You can finally define and consume your data models in the same way (syntax, behaviour, etc.) regardless of the SAP technology platform (ABAP or HANA). Unwantedly the phrase: "One Data Model to rule them all" always comes to mind when I think of CDS.

CDS Support in SAP NW ABAP 7.4 SP5

With SAP NW ABAP 7.4 SP5 the first instalment of CDS support in ABAP has been delivered. This provides you with advanced viewbuilding features which you can use to optimize your data models.

Prerequisite is the ABAP Development Tools for Eclipse (ADT) 2.19 since the new CDS tooling is only available in ABAP in Eclipse.

Let's take a look at some of these new features ABAP in Eclipse.

Create a new DDL source file

You can create a new DDL source in ABAP in Eclipse via File > New > Other ... > ABAP > DDL Source

View definition

Your new DDL source is opened in a text editor in ABAP in Eclipse. Initially the source is empty. Using the DEFINE VIEW statement you can define your CDS view entity.

View entities are defined as selects from one or more datasources. Datasources can be other view entities, database tables or classical DDIC views (SE11 views). The select list ist defined in curly brackets after the from clause (great for code completion!). The elements in the select list are separated by a comma. The code snippet above defines a simple view entity called SalesOrder on the database table SNWD_SO. SNWD_SO contains the sales orders data.

Currently you can only define one CDS entity per DDL source.

Joining data sources

You can combine records from two or more data sources using join clauses. You can also specify aliases for the datasources.

In addition to INNER JOIN you can also model a LEFT OUTER JOIN, RIGHT OUTER JOIN, UNION and/or UNION ALL.

The comparison operators BETWEEN, =, <>, <, >, <=, >=, NOT and LIKE can be used in the on and where clauses. In addition IS NULL and IS NOT NULL are also valid where-conditions.

Aggregations and SQL functions

CDS also provides support for aggregations (SUM, MIN, MAX, AVG, COUNT), SQL functions (LPAD, SUBSTRING, MOD, CEIL, CAST) and CASE statements in view entities.

In the above example the view selects the business partners with outstanding sales orders which together (SUM) amount to more than EUR 100.000 (HAVING SUM). The outstanding amounts are reported per business partner role (GROUP BY). The codes for the business partner roles are translated to readable text in the database (CASE).

Semantically rich data models

Annotations can be used to add metadata to CDS entities. Annotations specify the properties and semantics of the entity and its behaviour when it is accessed at runtime. This metadata can also be accessed by consumption tools using special APIs. In future, consumers will be able to extend existing view definitions and add their own annotations without having to re-model the data ("One Data Model to rule them all"). Annotations always begin with the @ character.

Above the SAP buffering behaviour is specified using the @AbapCatalog.buffering annotation. Here single record buffering is enabled (prerequisite is that the underlying datasource allows buffering). In addition the element currency_code is defined as a currency key. The element gross_amount is defined as a currency field and the currency key currency_code is assigned to the field.

In every view definition the compulsory annotation @AbapCatalog.sqlViewName must be specified. This annotation specifies the name of the corresponding view in the ABAP Dictionary. CDS entities are integrated into the ABAP Dictionary and ABAP language using the same infrastructure which exists for classical Dictionary views. The CDS entity name (here SalesOrder) can be thought of as an alias for the Dictionary View. The metadata which is specified for the CDS entity, however, can only be accessed via the entity name.

Further information about the supported predefined annotations can be found in our CDS keyword documentation.

Extensibility

The ABAP Dictionary enhancement concept is also supported in ABAP CDS entites. By using $EXTENSION.* in the select list, all fields that are added as enhancements to the underlying database table or classical DDIC view are automatically added to the CDS entity.

Here any fields which are added to the database table SNWD_SO via enhancements, will automatically be added to the view entity. Currently it is only possible to use $EXTENSION.* in view definitions with exactly one datasource (no joins, unions, etc.).


In future, CDS will also provide additional features for extending existing CDS entities themselves (not via the underlying datasource). These features will be available on both the ABAP and HANA platforms.

Consuming your CDS entities in ABAP

Once you have saved and activated your DDL source, the DDIC artifacts are created. Consuming your CDS entity is simple: CDS entities can be used in OPEN SQL! You should always use the entity name in your OPEN SQL statements.

SELECT * FROM SalesOrder INTO TABLE @itab. "Use entity name

Note that when selecting from CDS entities in OPEN SQL, the new OPEN SQL syntax must be used. This means that the ABAP variables (in this case itab) must be escaped using the @ character. The @ character in OPEN SQL has nothing to do with CDS annotations. For more information about the new OPEN SQL syntax, see the ABAP keyword documentation


Lifecycle and database support


The best part about DDL sources and CDS entities is that they are managed by ABAP. This means that the entire lifecyle of the CDS entities are controlled by the ABAP Change and Transport System (CTS).

In addition, the SP5 CDS features are "open". This means that your CDS view definitions can be deployed on any database which is supported by SAP.

Summary

Well, that was an attempt to give you a condensed overview of Core Data Services (CDS) in SAP NW ABAP 7.4 SP5. Not easy when you are introducing the next game changer in SAP application development.

To sum it up: CDS provides enhanced view building capabilities to enable you to easily define semantically rich and re-useable data models in the database. The new view building features include new join types, new clauses as well as support for aggregate functions and SQL functions. All these features are "open". The features are provided in a new text editor for DDL sources in ADT 2.19.

But the journey doesn't end here. There will continue to be future CDS feature deliveries in ABAP and even in 7.4 SP5 there is still a lot to tell. We haven't even touched on associations or the cast functionality, not to mention the cool editor features. But that will have to wait for another time (otherwise nobody will read this lengthly blog).

If you can't wait you can get more information by watching Carine's video tutorial ("Building Core Data Services Views in ABAP on SAP HANA"). Or you can check out our CDS keyword documentation. For more information about the CDS support in the HANA Platform, see the SAP HANA Developer Guide.




80 Comments
abdul_hakim
Active Contributor
0 Kudos

Hi Christiaan - What is the difference between creating the CDS view entity with annotation and without? This part is not clear for me..Also after defining the CDS view whether the same can be viewed through SE11?

Thanks

Hakim

Former Member
0 Kudos

Chris, Nice blog!

former_member205436
Participant
0 Kudos

Hi Hakim,

In the first delivery for CDS support in ABAP, we only support "core" annotations. This means that consumers cannot yet define their own annotations and further enrich the existing data models themselves.

Many of these core annotations have default values. If you do not, for example, specify the buffering behaviour for your view, then the default is "no buffering". So if you don't use the annotations, in many cases you get the default values. Some core annotations, however, don't have default values (e.g. "currency code" annotations). If you don't use these then the information is simply missing. You can still activate and use your view but higher-level tools, e.g. UIs, will not have any information about which field contains the currency code for an amount.

As mentioned above, in the context of ABAP, there is one compulsory annotation: @AbapCatalog.sqlViewName. You cannot activate your view if this annotation is not specified.

W.r.t you second question, the view entites cannot be viewed in the SE11. The corresponding DDIC view (specified in the sqlViewName annotation) can be viewed in the SE11, but the view is read-only and very often the informaton displayed is inconsistent. This is because CDS support many features which cannot be displayed in the SE11, e.g. UNIONs. The best place to browse the views is in the new DDL editor.

Regards

Chris

abdul_hakim
Active Contributor
0 Kudos

Hi Chris - Thanks for the clarification.

-Hakim

VikasSingh2
Active Participant

Great example !

I hope I'm not the only one tripped by omission of @ for Host variables when trying out these examples.

select * from salesorder into table lt_salesorder. <- Error

select * from salesorder into table @lt_salesorder. <- This works fine

former_member205436
Participant
0 Kudos

Hi Vikas,

Thanks, you are right. The host variable lt_salesorder in the OPEN SQL statement must be escaped using @. The usage of this escape character is not related to the @ in CDS annotations. This has to do with the new OPEN SQL syntax in SAP NetWeaver 7.4 SP5. In order to select from CDS entities in OPEN SQL, the new syntax must be used. This also includes separating the fields in the select list using a comma.

See Horst's blog (OPEN SQL, New Syntax) and the ABAP keyword documentation for more details.

I have updated the blog with this information.

Regards

Chris

VikasSingh2
Active Participant
0 Kudos

Thanks for the update Chris.

Former Member
0 Kudos

Hi Chris,

I was initially confused by the acronym CDS - Core Data Services - and it's similarity to CDS - Content Delivery Services, which allows for extensive data modelling in HANA. As far as I remember, the Content Delivery Services are also stored as "DDL" sources - or at least something similar (file suffix .hddbd). SAP is not making it easy for us 🙂

Regards,

Trond

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

From the HANA Native Development side we don't have a development object with the file suffix hddbd.  We do have hdbdd, but that is the same CDS - Core Data Services.  Its the same syntax used in ABAP DDL sources.  We use CDS in HANA Native to define tables, structures, associations, and views. It is also the core language within the data definition of the River syntax.

Myself and several others in the HANA development group have never head of Content Delivery Services nor had we heard of hddbd. There is not artifact with that extension documented in the HANA Development guide nor does it open any specific editor in HANA Studio.  Are you sure that perhaps you weren't thinking of hdbdd?

Former Member
0 Kudos

Hi Thomas,

you're perfectly right. Got the acronyms mixed up (guess I was subconsciously thinking of CDN as in internet content delivery services... another topic altogether).

Interesting that you make the link with RDL - I've been wondering about the similarities between CDS and RDL and how these fit together.

Regards,

Trond

UweFetzer_se38
Active Contributor
0 Kudos

Hi Christiaan,

if I'm using the substring element on MaxDB, I'm getting an error while generating the DDL:

Pressing "generate" a second time, I'm getting this:

If I'm commenting out this line, all is ok.

Any idea?

Uwe

jasmin_gruschke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Uwe,
can you have a look at the activation log? Click in the DDLS editor window and find the activation log in Navigate > Open Activation Log.

Cheers,

  Jasmin

UweFetzer_se38
Active Contributor
0 Kudos

No errors found in the log.

The log ends with:


Number of objects to be analyzed: 3


Number of relevant dependencies: 2


Level 1:1 objects assigned, 2 less dependencies


Level 2:2 objects assigned, 0 less dependencies


Graph_Analysis: 3 objects on 2 topological levels


*************************************************************************


      Calculation of Dependencies:
End phase  001 ***********************************************************


Start phase 002 **********************************************************


      Object Activationnull*************************************************************************


*** Activate objects at level 1


* Synchronous execution, no parallel processing *


Former Member
0 Kudos

Very interesting.

Just wonder:

How does it live together with SAP River?

0 Kudos

Hi Experts,

Can a CDS view be used in defining another CDS view (similar to how a table is used in defining a CDS view)?

Thanks & Regards,

Saurabh

former_member205436
Participant
0 Kudos

Hi Shai,

CDS is the "core" of SAP River. CDS enables the data modeling part of SAP River as well as the role based access control. In addition SAP River provides its own programming language to implement the business logic (actions) on top of the data model. See Introducing SAP River for more information.

To sum it up: You can use "pure" CDS to define your data models (as described in this blog) or you can use CDS in the context of  SAP River.

Regards

Chris

former_member205436
Participant
0 Kudos

Hi Saurabh,

Yes! Views on views are possible in CDS. In fact, this design pattern is heavily used to enable many of our SAP products which use CDS. A good example for this use-case is when you have to define a specialized "consumption view" for providing data to the UI. These consumption views are very often based on other CDS views.

Regards

Chris

former_member205436
Participant
0 Kudos

Hi Uwe,

Does this error still occur? If so, I'd suggest you open a customer message for the component BC-DWB-DIC.

Kind regards

Chris

0 Kudos

Thanks a lot for the quick response Chris!

Regards,

Saurabh

Former Member
0 Kudos

I note the comparison CDS - RDL and the comment that CDS is a core part of River. This also seemed evident from the launch of the two products. In spite of this, there are some annoying differences in syntax between the two languages (CDS and RDL), such as the following:

- in RDL, fields within entities have to be defined using the key word "element"; this is not needed (nor possible) in CDS

- after the ending curly bracket for defining an entity in CDS, you need a semi-colon; this is not the case in RDL

- no imperative logic in CDS

Copy/pasting an RDL model into a CDS file (or vice versa) is, in other words, not possible. It looks almost like SAP created CDS and RDL in parallel, or maybe defined CDS based on a previous (and non-released) version of RDL? At the very best, these two "almost-identical" syntaxes are confusing, and gives the impression of a certain lack of coordination between various departments or development groups. Even worse, I imagine it will be more and more difficult to iron these bumps out as RDL and CDS takes hold.

That is, if SAP doesn't decide to scrap one in favour of the other - if so, which one?

Regards,

Trond

PS: come to think of it, RDL is not released yet. Would it be possible to request someone at SAP to look into "syncing" the syntax properly?

UweFetzer_se38
Active Contributor
0 Kudos

Hi Chris,

Done. If you need the number, just ping me.

0 Kudos

Hi Chris,

Some more questions:-

1) Are selects from multiple tables allowed for CDS view definition, for example something like SELECT table1.column1, table2.column2 FROM table1, table2 WHERE table1.column1 = table2.column1;

2) Are nested joins allowed for CDS view definition; for example something like

select from ((A join B on..) as C join (D join E on..) as F on..)

As of now I am getting a syntax error for both 1 and 2.

Thanks & Regards,

Saurabh

steffen_weinstock
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trond,

in short and simplified: RDL = CDS + actions.

CDS is intended for defining data models, RDL adds imperative logic.

When restricted to pure model definition, CDS and RDL syntax should indeed be (almost) identical.

You are right with the assumption that different teams are working on CDS and RDL in parallel, but both are based on the same specification. Nevertheless it happens that there are (hopefully minor) misalignments concerning the syntax. They should be gone in the end.

Best regards,

Steffen

former_member205436
Participant
0 Kudos

Hi Saurabh,

In both cases this is possible.

1) You can model this in CDS using simple INNER JOINs. The condition in the WHERE clause can used for the join condition (ON clause). See the F1-Help for details.

2) You have to be careful how you use the brackets when doing nested joins. In your example "as C" must be contained within the brackets, e.g.: (A as X  inner join B as Y on X.f = Y.f ) inner join ( D as Z join E on Z.f = E.f  ) on X.f = Z.f

Kind regards

Chris

0 Kudos

Hi Chris,

I have to do multiple nested inner joins so I need to have aliases for the intermediate joins because some of the field names are same across tables used in the joins and also in the resultant intermediate joins. So my question is that in your example can I do something like this:-

((A as X  inner join B as Y on X.f = Y.f ) as AB) inner join (( D as Z join E on Z.f = E.f) as DE )

on AB.f = DE.f

Thanks for all the help you have already provided and in advance for thsi one 🙂

Regards,

Saurabh

UweFetzer_se38
Active Contributor
0 Kudos

Hi Christiaan,

we, or better burkhard.diesing , found the reason for the error: the first number isn't the offset (like in HANA?) but the starting position -> with substring( bpa.company_name, 1, 10 ) it works.

See ABAP documentation:


Substring of arg from the position pos in the length len. pos and len must be positive number literals.


But in my opinion:

  • MaxDB should behave the same like HANA
  • the syntax-check must fail

Cheers

Uwe

Former Member
0 Kudos

Hello Uwe,

the behaivior is the same but HANA doesn't throw an error and set the
startposition to 1 if 0 is given.

But you are right the syntax check should be fail or MaxDB accept the 0 too.


I will discuss this internally what needs to change to follow expectations.

Burkhard

0 Kudos

Hi Chris & Other Experts,

Can someone please help me with my last query (see above)?

Thanks & Regards,

Saurabh

andreas_gruenhagen
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Saurabh,

you cannot specifiy alias names for joins, neither in CDS nor in any SQL dialect I know.

But since you can use the alias names of tables in the on-condition, this is not necessary:

(A as X  inner join B as Y on X.f = Y.f ) inner join (D as Z join E on Z.f = E.f )

on X.f = Z.f

regards

Andreas

0 Kudos

Hi Andreas,

Thanks for the reply. I used aliases for joins in HANA SQL script. Basically I am trying to port a HANA SQL script based AMDP to a CDS view.

Here is the working code that I used:-

    METHODS hana_ld
      IMPORTING
        VALUE(mandt)     TYPE sy-mandt
        VALUE(it_geo_fr) TYPE t_loc
        VALUE(it_geo_to) TYPE t_loc
        VALUE(it_mtr)    TYPE t_mtr
      EXPORTING
        VALUE(et_l2l)    TYPE t_lane...

CLASS zsc_hana_ld IMPLEMENTATION.

METHOD hana_ld BY DATABASE PROCEDURE
                     FOR HDB LANGUAGE SQLSCRIPT
                     OPTIONS READ-ONLY
                     USING /scmb/toentity /sapapo/trm /scmtms/d_shzon.


    et_l2l = select '1' as "REQUEST_ID", e."GEO_FR", f."GEO_TO", e."TTYPE" as "MTR", e."TRMID_FR" as "TRMID", 0 as "DIST_DET_RELEVANT"
             from
             (select a."SCUGUID" as "GEO_FR", b."TRMID" as "TRMID_FR", b."TTYPE"
             from "/SCMB/TOENTITY" as a
             join
             "/SAPAPO/TRM" as b
             on a."SCUGUID22" = b."LOCFR"
             where a."SCUGUID" in (select "SCUGUID" from :it_geo_fr)
             and a."MANDT" = :mandt
             and b."MANDT" = :mandt
             and b."TTYPE" in (select "MTR" as "TTYPE" from :it_mtr) ) as e
             join
             (select c."SCUGUID" as "GEO_TO", d."TRMID" as "TRMID_TO"
             from "/SCMB/TOENTITY" as c
             join
             "/SAPAPO/TRM" as d
             on c."SCUGUID22" = d."LOCTO"
             where c."SCUGUID" in (select "SCUGUID" from :it_geo_to)
             and c."MANDT" = :mandt
             and d."MANDT" = :mandt
             and d."TTYPE" in (select "MTR" as "TTYPE" from :it_mtr)) as f
             on e."TRMID_FR" = f."TRMID_TO";

The aliasing of joins is needed because the output of such a join is needed in other joins and the field names are repeated across tables and joins within this join and outside of it.

Any further pointers would be highly appreciated.

Thanks & Regards,

Saurabh

andreas_gruenhagen
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Saurabh,

In your example, you are using sub selects in the from-clause. This is something we do not support in CDS, yet. In CDS you probably have to implement this using a view on view construct.

By the way, in your example you do not specify an alias name for a join but for a whole sub select inside the from clause. In this case the aliasing does make sense.

regards

Andreas

0 Kudos

Hi Andreas,

Thanks a lot for the quick reply. So with the current CDS capabilities I will have to use the view on view construct. I will try this out.

Also sorry for using the wrong terminology (joins vs. sub select)!!

Regards,

Saurabh

0 Kudos

How to consume native Hana Models like calc view in CDS ?

andreas_gruenhagen
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Joseph,

HANA calc views without parameters can be accessed in the ABAP / DDIC by creating an external View in the ADT (ABAP Development Tool). This view than can consumed in CDS View just like any other view or table declared in the DDIC.

Best regards

Andreas

YI00427
Explorer
0 Kudos

Hello Christian,

is it possible to use build in varibles in the where condition of an CDS view  ? In Detail i want to use the actual Date (sy-datum) as an condition Parameter. If i could use this Parameter directly, without an inputparameter for the view, i could use the view directly in a SADL Query for displaying the results in a FPM Application.

best regards

Marcel_Hermanns
Advisor
Advisor
0 Kudos

Hi Martin,

CDS does not support SY parameters. However, you can use view parameters as you proposed and set the value (e.g. sy-langu) via a dedicated interface.

For Gateway / OData Services via the query options API:

http://scn.sap.com/docs/DOC-51475

4.10

FPM: Will check with FPM colleagues.

Best regards

Marcel


0 Kudos

Hello Martin,

view parameters can only be set by sub-classing the standard feeder class. In a subclass of CL_FPM_SADL_SEARCH_RESULT you can redefine method PREPARE_PBO with code like this:

*******************************************************************************************

*----- inherit
    super->prepare_pbo( io_event ).

*----- test setting view parameters
    CHECK io_event->mv_event_id = ....<some condition if not desired each time>
    set_view_parameters( VALUE #( ( name = 'HUGO' value = 'HALLO' ) ) ).

*******************************************************************************************

An example is given in class CL_FPM_TEST_SADL_SRES_CUSTOM which is used in Test App FPM_TEST_SADL_SBOOK_CUSTOM (here only on DDIC, nit CDS, but the code is the same).

Best regards

Jens

0 Kudos

Chris,

Can you define ABAP DDIC tables using CDS?

Amiya

former_member205436
Participant
0 Kudos

Hi Amiya,

this is currently not possible for ABAP developers but it is in the pipeline. Since most of SAP's software solutions already have/had their persistencies, the main focus has been on view building to enable code pushdown. Although there are plans to support defining database tables using CDS (with a similar integration in DDIC), I cannot give you a timeline.

The CDS implementation on SAP HANA, however, already offers this possibility. If you are doing HANA native development, you SHOULD already be using CDS to create your database tables (entities) instead of HDBTable. But any database tables defined directly in the  HDB are not integrated into ABAP DDIC and the ABAP language.

Cheers

Chris

0 Kudos

Thanks! Chris. Also, I wanted to confirm if data manipulation is not possible using these views.

former_member199076
Participant
0 Kudos

Hi Chris,

You mention that "Annotations can be used to add metadata to CDS entities. Annotations specify the properties and semantics of the entity and its behaviour when it is accessed at runtime. This metadata can also be accessed by consumption tools using special APIs."

What are these APIs?

Thanks.

former_member199076
Participant
0 Kudos

I should clarify. Do you know if there is a way to access the annotation metadata outside of ABAP (i.e. directly through some HANA interface like XSJS)?

Thanks.

UweFetzer_se38
Active Contributor
former_member205436
Participant
0 Kudos

These views are  read-only. The CDS specification allows for updateable views, but they are not yet implemented. Currently there are investigations on how to used SADL and BOPF to enable "write" scenarios, including transactional handling (disclaimer here!), but again this is something for the furture.

0 Kudos

Thanks for clarification, Chris.

former_member205436
Participant
0 Kudos

Hi Eric,

here again we have to differentiate between the CDS implementation in ABAP (with DDIC support and running in the ABAP Application Server) and the implementation in HDB (with its own repository and independent of ABAP/DDIC).

You are referring to the possibility to define your own annotations in HANA CDS to annotate your entities which you defined in HANA (.hdbdd files). This is possible since HANA SPS9. Currently these annotations (the metadata) can only be accessed by SAP consumption tools. In other words, to date only internal APIs exist. There are plans to deliver public APIs with SPS10 (disclaimer here!). Then "external" consumers (in the context of HANA development) will also be able to access this information, e.g. via XSJS. It is important to note that these entities and their metadata are managed by the HANA DBMS, independent of the ABAP DDIC and ABAP runtime. This information is not found in the database tables mentioned by Uwe (since DDIC is not involved here).

In ABAP the situation is somewhat different. In ABAP CDS entities are defined and managed in/by the ABAP Repository, independent of the HANA catalog. In fact, ABAP CDS is "open". You can use these CDS features regardless of the underlying database. Currently you cannot define your own annotations in ABAP CDS (like in HANA CDS), but you can simply write the annotation in the DDL source. During activation these annotations are not validated (like in HANA) but simply stored in the ABAP Repository as metadata (in the database tables mentioned by Uwe). Here again there are currently also no official ABAP APIs to access this data. In the future official APIs will be delivered.

To sum it up. Depending on where you define your CDS entities (ABAP or HANA), the metadata is stored in different repositories. Currently there are no official APIs for these repositories (neither in ABAP nor HANA). But they are on their way ...

Regards

Chris

former_member205436
Participant
0 Kudos

Hi Uwe and Burkhard,

Since SP8, the syntax check now fails if the offset isn't a positive integer value.

I have updated the screenshot in the blog to now use substring(bpa.company_name, 1, 10).

Cheers

Chris

0 Kudos

Chris,

Could you tell me where I can find a features-by-releases matrix for ABAP and HANA CDS? I searched on the internet but couldn't find one.

I am looking for something of the below sort:

http://scn.sap.com/community/abap/eclipse/blog/2013/06/05/adt-feature-availability-matrix-for-as-aba...

Amiya

hardyp180
SAP Mentor
SAP Mentor
0 Kudos

Coming bcak to the @semantics again, in your example you link the currency field to the amont field, just like in ABAP DDIC tables where amount fields must point to a curency field like WAERS, and quantity fields must point to a unit of measure field like MEINS.

Since this is enforced in the ABAP DDIC the underlyin tables already have this information inside SAP - therefore is this semantic information intended for non-SAP based consumers e.g. EXCEL or a third party software system?

Is this like in the SEGW gateway transaction where I can add semantic information to say a field is a geo-co-ordinate so when something like Google Maps can access the data model it knows for sure what the co-ordinate fields are?

I may have this all wrong, but to keep ploughing ahead does this extra semantic information have any purpose within the ABAP environment?

Cheersy Cheers

Paul

former_member205436
Participant
0 Kudos

Hi Amiya,

take a look here: http://scn.sap.com/community/abap/blog/2015/02/02/core-data-services-cds-abap-feature-matrix .

I tried to give you a quick overview of the features delivered with SAP NW 7.4 SP5 and SP8. Of course there is always the ABAP Keyword Documentation which you can refer to.

Regards

Chris