You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/abap-environment-analytics/abap-environment-analytics.md
+15-19Lines changed: 15 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Always replace `####` with your initials or group number.
33
33
The new **RAP based InA service exposure** enables the SAP Business Technology Platform ABAP Environment developers to develop analytical queries(based on ABAP-CDS analytical data models) and expose them via the `InA` (Information Access) service protocol. In this Tutorial you will create a complete Analytical Data Model for Booking data. This consists out of dimensions for Carrier, Customer, Connection and Agency data, as well as an interface CDS view for Booking data which acts as a data source for the cube and query.
34
34
These analytical queries can be further consumed in the SAP Analytics cloud to create analytical models, stories, multi-dimensional reports and more.
35
35
36
-

36
+

37
37
38
38
39
39
### Import templates for Analytical CDS views
@@ -491,7 +491,7 @@ This annotation is part of the template **Define a View Entity for a Cube** that
491
491
492
492
- **Name**: `ZRAP500_I_BookingCube_####`
493
493
- **Description**: `Booking Cube`
494
-
- **Referenced Object**: `ZRAP_I_BOOKING_####` (The booking interface view)
494
+
- **Referenced Object**: `ZRAP500_I_BOOKING_####` (The booking interface view)
495
495
496
496

497
497
@@ -525,7 +525,7 @@ This annotation is part of the template **Define a View Entity for a Cube** that
525
525
526
526
6. Comment out both lines of annotation `@Semantics.amount.currencyCode` and the property **Flight Price**.
527
527
528
-
7. Add the following two fields alongside with a foreign key association
528
+
7. Add the following two fields alongside with a foreign key association
@@ -636,7 +636,7 @@ This annotation is part of the template **Define a View Entity for a Cube** that
636
636
### Implement query as CDS view entity
637
637
638
638
639
-
Since a query belongs to the projection layer (formerly known as consumption layer) it must have a **C** in its name according to the naming convention used in the Virtual Data Model (VDM) used in SAP S/4HANA. To create a query, there is a mandatory header annotation: **@Analytics.query: true**
639
+
Since a query belongs to the projection layer (formerly known as consumption layer) it must have a **C** in its name according to the naming convention used in the Virtual Data Model (VDM) used in SAP S/4HANA.
640
640
641
641
Again you can use a template that you have imported at the beginning of this tutorial.
642
642
@@ -657,9 +657,9 @@ Again you can use a template that you have imported at the beginning of this tut
657
657
658
658

659
659
660
-
5. Edit the code of your query and add the annotation **@AnalyticsDetails.query.axis** to all properties except the two measures `FlightPrice` and `TotalOfBookings`. All fields beside the field `CustomerCountry` get the annotation **@AnalyticsDetails.query.axis: #ROWS**, whereas the field `CustomerCountry` gets the annotation **@AnalyticsDetails.query.axis: #COLUMN**.
660
+
5. Edit the code of your query with removing **KEY** from `TravelID` and `BookingID`, add the annotation **@AnalyticsDetails.query.axis** to all properties except the two measures `FlightPrice` and `TotalOfBookings`. All fields beside the field `CustomerCountry` get the annotation **@AnalyticsDetails.query.axis: #ROWS**, whereas the field `CustomerCountry` gets the annotation **@AnalyticsDetails.query.axis: #COLUMN**.
661
661
662
-
6. You add a currency conversion to the field `FlightPrice` to be able to comparison all flight prices in a single currency.
662
+
6. You add a currency conversion to the field `FlightPrice` to be able to comparison all flight prices in a single currency.
663
663
664
664
```
665
665
@Semantics.amount.currencyCode: 'CurrencyCode'
@@ -676,25 +676,22 @@ Again you can use a template that you have imported at the beginning of this tut
676
676
677
677

678
678
679
-
> Using the template the mandatory annotations for query is set automatically.
680
-
> **@Analytics.query: true**
681
679
> With the annotation **@AnalyticsDetails.query.axis:<VALUE>**, the elements of the view can be positioned on multiple axes: Rows, Columns and Free. The elements can be directly annotated with their axis. All measures (elements which can be aggregated) need to be on the same axis. The annotation of the first measure will therefore be used for all measures of the query. If **@AnalyticsDetails.query.axis:<VALUE>** is not found, the system positions the measures on the columns.
682
680
683
681
8. Your final code should look like the following:
684
682
685
683
```ZRAP500_C_BOOKINGQUERY_####
686
-
@AccessControl.authorizationCheck: #CHECK
687
-
@EndUserText.label: 'Query for Booking'
688
-
689
-
690
-
@Analytics.query: true
684
+
@EndUserText.label: 'Flights Query'
685
+
@AccessControl.authorizationCheck: #NOT_ALLOWED
691
686
692
-
693
-
define view entity ZRAP500_C_BOOKINGQUERY_#### as select from ZRAP500_I_BookingCube_#### {
687
+
define transient view entity DEF23_Flights_Query
688
+
provider contract analytical_query
689
+
as projection on DEF23_Flights_Cube
690
+
{
694
691
@AnalyticsDetails.query.axis: #ROWS
695
-
key TravelID,
692
+
TravelID,
696
693
@AnalyticsDetails.query.axis: #ROWS
697
-
key BookingID,
694
+
BookingID,
698
695
@AnalyticsDetails.query.axis: #ROWS
699
696
BookingDate,
700
697
@AnalyticsDetails.query.axis: #ROWS
@@ -733,8 +730,7 @@ Again you can use a template that you have imported at the beginning of this tut
733
730
734
731
### Data preview
735
732
736
-
737
-
Similar to the SAP Fiori Elements preview which is offered for OData V2 UI and OData V4 UI service bindings there is now an Analytical Data Preview available. This can be used by the ABAP developer to test the implementation of an Analytical Query since the preview uses the InA protocol.
733
+
Similar to the SAP Fiori Elements preview which is offered for OData V2 UI and OData V4 UI service bindings there is now an Analytical Data Preview available. This can be used by the ABAP developer to test the implementation of an Analytical Query since the preview uses the InA protocol.
738
734
739
735
Now that you have created the query it is possible to use a data preview to test our implementation.
0 commit comments