@AbapCatalog.sqlViewName: 'ZT179'
@VDM.viewType: #BASIC
@EndUserText.label: 'Product Hierarchy'
define view z_t179 as select from t179 {
key prodh,
left(prodh,2) as prodh1,
left(prodh,5) as prodh2,
left(prodh,8) as prodh3,
left(prodh,13) as prodh4,
stufe
}
@AbapCatalog.sqlViewName: 'ZIPRODHNDH'
@Analytics.dataCategory: #HIERARCHY
@ObjectModel.representativeKey: 'ProductHierarchyChild'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Product Hierarchy Node'
@Hierarchy.parentChild.rootNode.visibility:#ADD_ROOT_NODE
@Hierarchy.parentChild.name: 'PROD_HIER'
@Hierarchy.parentChild.label: 'Product Hierarchy'
@Hierarchy.parentChild: { recurse: {
parent: 'ProductHierarchyNodeParent', child: 'ProductHierarchyNodeChild' } }
define view ZI_ProductHierarchyNodeHier as select distinct from z_t179 as t179_child inner join z_t179 as t179_parent
on t179_child.prodh3 = t179_parent.prodh3
and t179_child.stufe = '4'
and t179_parent.stufe = '3'
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode
{
@ObjectModel.foreignKey.association: '_ProductHierarchyNode'
key t179_child.prodh as ProductHierarchyNodeChild,
t179_parent.prodh as ProductHierarchyNodeParent,
t179_child.stufe,
_ProductHierarchyNode
}
union
select distinct from z_t179 as t179_child inner join z_t179 as t179_parent
on t179_child.prodh2 = t179_parent.prodh2
and t179_child.stufe = '3'
and t179_parent.stufe = '2'
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode
{
@ObjectModel.foreignKey.association: '_ProductHierarchyNode'
key t179_child.prodh as ProductHierarchyNodeChild,
t179_parent.prodh as ProductHierarchyNodeParent,
t179_child.stufe,
_ProductHierarchyNode
}
union
select distinct from z_t179 as t179_child inner join z_t179 as t179_parent
on t179_child.prodh1 = t179_parent.prodh1
and t179_child.stufe = '2'
and t179_parent.stufe = '1'
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode
{
@ObjectModel.foreignKey.association: '_ProductHierarchyNode'
key t179_child.prodh as ProductHierarchyNodeChild,
t179_parent.prodh as ProductHierarchyNodeParent,
t179_child.stufe,
_ProductHierarchyNode
}
union
select distinct from z_t179 as t179
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode
{
@ObjectModel.foreignKey.association: '_ProductHierarchyNode'
key t179.prodh as ProductHierarchyNodeChild,
cast('' as prodh_d) as ProductHierarchyNodeParent,
t179.stufe,
_ProductHierarchyNode
} where stufe = '1'
@AbapCatalog.sqlViewName: 'ZMAT'
@VDM.viewType: #BASIC
@EndUserText.label: 'Material'
define view ZI_Material as select from ZI_ProductHierarchyNodeHier
{
key cast(ProductHierarchyNodeChild as abap.char(40)) as nodeid,
key cast(ProductHierarchyNodeParent as prodh_d) as parentid,
cast(ProductHierarchyNodeChild as prodh_d) as prodh,
cast('' as matnr) as material
}
union
select from ZI_ProductHierarchyNodeHier as prodh join mara
on prodh.ProductHierarchyNodeChild = mara.prdha
{
key cast(mara.matnr as abap.char(40) ) as nodeid,
key cast(prodh.ProductHierarchyNodeChild as prodh_d) as parentid,
cast('' as prodh_d) as prodh,
mara.matnr as material
}
@AbapCatalog.sqlViewName: 'ZIMATHIER'
@EndUserText.label: 'Material'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #BASIC
@ObjectModel.dataCategory: #HIERARCHY
@Hierarchy.parentChild: [{
rootNode.visibility:#ADD_ROOT_NODE,
name : 'MAT_HIER',
label: 'Material Hierarchy',
siblingsOrder: [{ by: 'material', direction: #ASC }],
recurseBy: '_parent'
}]
define view ZI_MaterialHier as select from ZI_Material
association[0..1] to ZI_MaterialHier as _parent on $projection.parentid = _parent.nodeid
association[0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.prodh = _ProductHierarchyNode.ProductHierarchyNode
and $projection.material = ''
association[0..1] to I_Material as _Material on $projection.material = _Material.Material
and $projection.prodh = ''
{
key nodeid,
parentid,
@ObjectModel.foreignKey.association: '_ProductHierarchyNode'
prodh,
@ObjectModel.foreignKey.association: '_Material'
material,
_parent,
_ProductHierarchyNode,
_Material
}
@VDM.viewExtension: true
@AbapCatalog.sqlViewAppendName: 'ZXMATERIAL'
@EndUserText.label: 'Material'
extend view I_Material with ZX_Material
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode1 on $projection.ProductCategory = _ProductHierarchyNode1.ProductHierarchyNode
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode2 on $projection.ProductClass = _ProductHierarchyNode2.ProductHierarchyNode
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode3 on $projection.ProductSubClass = _ProductHierarchyNode3.ProductHierarchyNode
association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode4 on $projection.ProductFamily = _ProductHierarchyNode4.ProductHierarchyNode
{
bismt,
volum,
@ObjectModel.foreignKey.association: '_ProductHierarchyNode1'
cast(left(prdha,2) as prodh1) as ProductCategory,
@ObjectModel.foreignKey.association: '_ProductHierarchyNode2'
cast(left(prdha,5) as zprodh2) as ProductClass,
@ObjectModel.foreignKey.association: '_ProductHierarchyNode3'
cast(left(prdha,8) as zprodh3) as ProductSubClass,
@ObjectModel.foreignKey.association: '_ProductHierarchyNode4'
cast(left(prdha,13) as zprodh4) as ProductFamily,
_ProductHierarchyNode1,
_ProductHierarchyNode2,
_ProductHierarchyNode3,
_ProductHierarchyNode4
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |