Tuesday, 12 October 2021 15:25

Filtering by Short Material Product Hierarchy Dimension Keys with ABAP CDS Views

Written by Uladzislau Pralat
Rate this item
(0 votes)
Source https://blogs.sap.com/2021/10/13/filtering-by-short-material-product-hierarchy-dimension-keys-with-abap-cds-views/
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”

I previously explained how to Display Short Material Product Hierarchy Level Keys with ABAP CDS Views. But what if you want to use short Material Product Hierarchy dimensions instead of hierarchy levels? Displaying dimension is not an issue, but how to filter dimension by short key value? If this question challenges you, then my new blog is for you.

There is one line of code solution for this problem. It is often like that with SAP development. The biggest challenge is where to write that single line of code and what that line should be.

In our case the line of code is in ABAP CDS view dimension’s data element’s domain conversion route input function module. And the line of code is adding leading asterisk (*) before short dimension value key.

The line of code does the trick converting dimension short key value into pattern selection

For the sake of completeness, here is conversion route output function module

This is how Material Product Hierarchy dimensions are defined

For ease of Material Product Hierarchy dimensions use, I also recommend to extend I_Material dimension CDS view

It is easy to define Material Product Hierarchy dimensions referring to I_Material attributes

Source codes can be downloaded from GitHub:

ZI_ProductClass

ZI_ProductClassText

CONVERSION_EXIT_ZPH2_INPUT

CONVERSION_EXIT_ZPH2_OUTPUT

ZX_Material

P.S. In case Patterns/Wildcards in prompts are not enabled in your Analysis for Office installation, please add <OperatorContainsPattern value=”True” /> string to your Analysis for Office configuration file C:\Users\<user name>\AppData\Roaming\SAP\Cof\Ao_user_roaming.config

For more S/4HANA Embedded Analytics tips and tricks please refer to my book SAP S/4HANA Analytical Applications with Fiori Elements

Continue reading here
Read 37 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.