Skip to Content
Technical Articles
Author's profile photo Uladzislau Pralat

Display Short Material Product Hierarchy Level Keys with ABAP CDS Views

Previously I explained how to Add Multiple T179 Material Product Hierarchies to S/4HANA Embedded Analytics Content. Material Product Hierarchy displays long levels key based on T179 table, but users accustomed to see individual level short keys the ways they maintained in MM02 transaction. Take Material Product Hierarchy to a next level addressing user requirements.

Below is how users assign hierarchy levels are maintained in MM02 transaction

Users expect to see the same short Material Product Hierarchy level keys in ABAP CDS view queries. Unfortunately, it is not the case. Hierarchy level keys are displayed the way they are stored in T179 table

This blog explains how to display short Material Product Hierarchy level keys as shown below

All it takes is to make some minor changes to I_ProductHierarchyNode CDS view casting Product Hierarchy Node using custom ZPRODH data element

ZPRODH data element created on top of ZPRODH domain which is using ZPH conversion routine.

The trick is in ZPH conversion routine. What conversion routine is doing is removing preceding hierarchy levels during output.

ZPH conversion routine is defined with using two function modules CONVERSION_EXIT_ZPH_INPUT and CONVERSION_EXIT_ZPH_OUTPUT. Output routing is doing the trick

Input routing is not doing much

CONVERSION_EXIT_ZPH_OUTPUT can be downloaded from GitHub

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

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

 

 

 

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.