Visualización de claves de nivel de jerarquía de productos de material corto con vistas CDS de ABAP
La Jerarquía de Productos de Material muestra la clave de los niveles largos basada en la tabla T179, pero los usuarios están acostumbrados a ver las claves cortas de los niveles individuales de la forma en que se mantienen en la transacción MM02. Lleve la Jerarquía de Productos Materiales a un siguiente nivel atendiendo a las necesidades de los usuarios.
A continuación se muestra cómo los usuarios asignan los niveles de jerarquía se mantienen en la transacción MM02

Los usuarios esperan ver las mismas claves cortas del nivel de jerarquía de productos de material en las consultas de la vista CDS de ABAP. Lamentablemente, no es el caso. Las claves de nivel jerárquico se muestran tal y como se almacenan en la tabla T179


En este blog se explica cómo mostrar claves cortas de nivel de jerarquía de productos de material como se muestra a continuación

Todo lo que se necesita es hacer algunos cambios menores en la vista I_ProductHierarchyNode CDS que arroja el Nodo de Jerarquía de Productos utilizando el elemento de datos personalizado ZPRODH

Elemento de datos ZPRODH creado sobre el dominio ZPRODH que utiliza la rutina de conversión ZPH.


El truco está en la rutina de conversión de ZPH. Lo que hace la rutina de conversión es eliminar los niveles jerárquicos anteriores durante la salida.

La rutina de conversión ZPH se define con el uso de dos módulos de función CONVERSION_EXIT_ZPH_INPUT y CONVERSION_EXIT_ZPH_OUTPUT. El enrutamiento de salida está haciendo el truco

El enrutamiento de entrada no está haciendo mucho

CONVERSION_EXIT_ZPH_OUTPUT puede descargarse de GitHub
Source: sap.com