Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic field label in CDS view

jasonmuzzy
Active Participant

How can I create a dynamic field label in ABAP CDS? The @EnduserText.label annotation appears to be for translatable text and doesn't seem to have the ability to have dynamic elements like a BW text variable.

The user will enter a fiscal year/period, then from that the current period and previous 11 periods will be shown as columns, with additional calculated columns at the end for difference ($) for the chosen and prior period, and diference (%) for the chosen and prior period. Because of the requirement to have the additional calculated columns at the end we can't simply use a crosstab and drill down by period in the columns.

For example:

5/2016   6/2016   ...   4/2017   5/2017   Difference ($)   Difference (%)
$1       $2       ...   $3       $4       $1               25%

We're using S4/HANA version 1610 and will be displaying in WebI 4.2 SP3 patch 3.

1 ACCEPTED SOLUTION

sap_cohort
Active Contributor
0 Kudos

Whoa! Does anyone know anything about the CDS Annotation @Consumption.dynamicLabel?
Can't seem to find any information on this...

3156575 - Dynamic Label in a CDS Query is Truncated

15 REPLIES 15

D039507
Advisor
Advisor

Hi,

I have the same problem, did you find a solution for that?

Thanks in advance

Thorsten

kapilkarwa
Explorer
0 Kudos

I too have same issue, Is there any solution to it

jasonmuzzy
Active Participant
0 Kudos

I still haven't found a solution for this and so we're doing clunky work-arounds with formulas in WebI. This doesn't help in other BI client tools like Analysis or Fiori tiles themselves.

0 Kudos

Hi Jason,

We too have same issue, did you find the solution for this issue?

Thanks.

jasonmuzzy
Active Participant
0 Kudos

Hi Venkata,

No, I didn't get a solution. I opened an incident with SAP on this topic in 2017 and they replied saying development had added it to the feature list for a future release. I don't see any changes in 1709, we'll see if 1809 brings any changes.

former_member205144
Active Participant
0 Kudos

Anybody found a solution for this? Is this feature available in 1809 ?

PMathieu
Explorer
0 Kudos

Hi, I have the same issue and I solved this problem by creating the Query in BEX Query based on the CDS VIEW (CUBE)

In the BEX Query (Embedded BI on S/4) I can defined my restrict mesure and I can defined TEXT Variable

Pat

0 Kudos

Hi pmathieu_2016

I am also facing the same issue.. Can you explain briefly about BEX Query.

Thanks

Himanshu kawatra

dwilson13027
Participant
0 Kudos

Hi All -

We have an AR age query (in embedded anlaytics) where the user will enter the ages for the buckets (eg., 30, 60, 90) and we want that 'ages' to be included in the column label header. This conversation sounds similar to our requirement. Has anyone been able to figure it out?

Thanks

Dennis Wilson

jasonmuzzy
Active Participant
0 Kudos

Hi Dennis, as of 1809 there is still no option for dynamic labels in CDS. I can't speak for newer releases. As an alternative, you could look at creating a BEx query using BEx Query Designer and then use a text replacement variable to show the age bucket variable values on the column headers. So you'd still use CDS to create the cube, but then use BEx instead of a CDS consumption view.

sap_cohort
Active Contributor
0 Kudos

Whoa! Does anyone know anything about the CDS Annotation @Consumption.dynamicLabel?
Can't seem to find any information on this...

3156575 - Dynamic Label in a CDS Query is Truncated

Great find! I found some info on the wiki:

See note 1 on variables: https://wiki.scn.sap.com/wiki/display/BI/CDS+views%3A+HowTo+use+in+BW+contexts#CDSviews:HowTouseinBW...

Usage: https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=598215303

Text variables: https://wiki.scn.sap.com/wiki/display/BI/CDS+views%3A+HowTo+use+in+BW+contexts#CDSviews:HowTouseinBW...

Example with screenshot: https://wiki.scn.sap.com/wiki/display/BI/CDS+Query+with+Text+Variables

Unfortunately it appears to be limited to replacement from parameters only, and is not capable of replacing from dimensions (like we were able to with BW text replacement variables). But, parameters should be useful in a lot of scenarios.

It's not available in my S4 1809 system with BW 7.53 component, so it may require at least BW 7.55 (S4 2020) based on the note you found.

sap_cohort
Active Contributor
0 Kudos

Thanks for sharing the info with all!
I am seriously mystified and struggle to understand why I cannot find any of this information in SAP Documentation...

Yeah, it should be documented with the Analytics annotations but it's not, at least not yet!

https://help.sap.com/docs/ABAP_PLATFORM_NEW/cc0c305d2fab47bd808adcad3ca7ee9d/c2dd92fb83784c4a87e16e6...

sap_cohort
Active Contributor
0 Kudos

Any SAP Employee Community members out there that might be able to get us some formal information on this functionality ??? Thanks!