Recently I got a requirement to create an account payable aging report which contains dynamic text based on user input, for example, user input aging interval as: 30, 60, 90. in the output of the report, the required report format will be:
CustomerDue in 30 daysDue in 31-60 daysDue in 61-90 daysDue 91+ days1001$300$600$900$1200
In the traditional SAP BW world, this can be easily achieved by Text variable, however in SAP CDS view, dynamic text is not available in early versions. In my current system version, the version is ABAP 7.58, and it supports this annotation very well.
So instead of going this complex scenario, I will use a simple SAP data source: SFLIGHT to achieve the similar requirement.
Scenario explanation:
There will be only one base measure called Airfare, based on the user input: number of Days X, the output will show the AirFare, X Days AirFare, X+1 Days AirFare, the highlighted two columns text will be dynamically derived based on the user input
Year MonthAirFare10 Days AirFare11 Days AirFare02.2023$300$600$900
This is how the end to end implementation work look like
Define a helper view: this is to return the day + 1
Define cube level data model, with base fare, base fare * input days, base fare * input days + 1, the measure if purely for distingush the different dollar value
Comes with the fun part, in the query view, we define the parameter which populate the derived dayPlus1 using lookup view which defined in first step:
In the measure column, wewill appy the dynamic text using annotation: @Consumption.dynamicLabel:
Now Let’s run the CDS view from BW query, as you can see user will be prompt to fill input days (default value is 10):
The measure column will derive the text dynamically based on user input and helper view:
With the help to combine annotation @Consumption.dynamicLabel and @Consumption.derivation.lookupEntity, we will be able to achieve the same requirement in the BW world by using Text variable and custom exit.
I hope this blog give you some help with the how dynamic text can be implemented using SAP CDS view, if you have any questions, please feel free to leave a message.
Recently I got a requirement to create an account payable aging report which contains dynamic text based on user input, for example, user input aging interval as: 30, 60, 90. in the output of the report, the required report format will be:CustomerDue in 30 daysDue in 31-60 daysDue in 61-90 daysDue 91+ days1001$300$600$900$1200In the traditional SAP BW world, this can be easily achieved by Text variable, however in SAP CDS view, dynamic text is not available in early versions. In my current system version, the version is ABAP 7.58, and it supports this annotation very well.So instead of going this complex scenario, I will use a simple SAP data source: SFLIGHT to achieve the similar requirement.Scenario explanation:There will be only one base measure called Airfare, based on the user input: number of Days X, the output will show the AirFare, X Days AirFare, X+1 Days AirFare, the highlighted two columns text will be dynamically derived based on the user inputYear MonthAirFare10 Days AirFare11 Days AirFare02.2023$300$600$900This is how the end to end implementation work look likeDefine a helper view: this is to return the day + 1Define cube level data model, with base fare, base fare * input days, base fare * input days + 1, the measure if purely for distingush the different dollar valueComes with the fun part, in the query view, we define the parameter which populate the derived dayPlus1 using lookup view which defined in first step:In the measure column, wewill appy the dynamic text using annotation: @Consumption.dynamicLabel:Now Let’s run the CDS view from BW query, as you can see user will be prompt to fill input days (default value is 10):The measure column will derive the text dynamically based on user input and helper view: With the help to combine annotation @Consumption.dynamicLabel and @Consumption.derivation.lookupEntity, we will be able to achieve the same requirement in the BW world by using Text variable and custom exit. I hope this blog give you some help with the how dynamic text can be implemented using SAP CDS view, if you have any questions, please feel free to leave a message. Read More Technology Blog Posts by Members articles
#SAP
#SAPTechnologyblog