on 2024 Aug 08 5:55 AM - last edited on 2024 Aug 08 6:46 PM by jerryjanda
Hi Everyone ,
As i am new to the S/4 Hana Development , Can anyone share me any document or suggest me how to create a AMDP Class with a Standard CDS Query and Get that Procedure Result in a New CDS Format .
It will be very helpful for me .
Thanks in advance
Thank you for your question, @SiddharthaDas.
without any further context I could imagine a number or ways to take advantage of the abstraction and readily available services provided with core data services and their views without even the need to go down to the underlaying data model or entities.
Let’s dive into how you can consume standard CDS views in ABAP, especially with an emphasis on extensions in embedded Steampunk (SAP S/4HANA with Steampunk capabilities).
When working with CDS views in ABAP, especially in the context of extending functionalities in embedded Steampunk, you will typically:
You can consume existing standard CDS views or create your own. Let's start with an example where we have a standard CDS view and we want to extend it.
Assume you have a standard CDS view SAP_CDS_VIEW.
If you need to extend this standard CDS view, you can use the EXTEND VIEW statement:
@AbapCatalog.sqlViewName: 'ZCDSVIEWEXT'@EndUserText.label: 'Extended CDS View'extend view SAP_CDS_VIEW with ZCDS_VIEW_EXTENSION { new_field1, new_field2}
Once you have your CDS views (extended) as per need, you can read them in your ABAP code. In embedded Steampunk, the process is similar to classical ABAP but optimized for cloud.
Here’s how you can consume this CDS view in your ABAP program:
DATA: lt_data TYPE TABLE OF zcds_view_extension. SELECT * FROM zcds_view_extension INTO TABLE lt_data. LOOP AT lt_data INTO DATA(ls_data). WRITE: / ls_data-field1, ls_data-field2, ls_data-field3.ENDLOOP.
In analytical scenarios, you typically use CDS views for defining complex queries and projections. These views can be directly consumed in SAP Fiori apps or analytical tools.
Suppose you have extended or created analytical CDS views tagged with annotations for analytical purposes:
@Analytics.query: true@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Analytical CDS View'define view ZANALYTICAL_CDS_VIEW as select from SAP_CDS_VIEW { key field1, field2, field3, @AnalyticsDetails.query.display: [ { position : 1, label: 'Measure 1' } ] measure1, @AnalyticsDetails.query.display: [ { position : 2, label: 'Measure 2' } ] measure2}
When working in embedded Steampunk, you'd typically use ABAP Development Tools (ADT) in Eclipse. Here's a brief on how to proceed:
By following this approach, you can seamlessly transition your old ABAP skills into the new age of ABAP with CDS views, ensuring clean, maintainable, and efficient extensions in embedded Steampunk.
Feel free to ask if you need any more details or further clarification! Otherwise, please mark this question as solved. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.