define view ZTESTSTPOEQSTEQUI
as select from I_BillOfMaterialItemBasic
{
key BillOfMaterialCategory,
key BillOfMaterial,
key BillOfMaterialItemNodeNumber,
key BOMItemInternalChangeCount,
_BOMEqstEqui.Equipment as Equipment,
_BOMEqstEqui.Material as CompositeMaterial,
_BOMEqstEqui.SerialNumber as Compositeserialnumber,
SerialNumber as MountSerialNumber,
BillOfMaterialComponent,
BatchNumber,
/* Associations */
_BOMEqstEqui,
_ComponentBOMEquip,
_Recursion
}
@Hierarchy.parentChild: [ { name: 'Recursion', recurseBy: '_Recursion' } ]
@Hierarchy.parentChild: [ { name: 'Recursion', recurseBy: '_Recursion' } ]
define view ZTESTSTPOEQSTEQUI
as select from I_BillOfMaterialItemBasic
association [0..1] to ZTESTSTPOEQSTEQUI as _Recursion on $projection.CompositeMaterial = _Recursion.BillOfMaterialComponent
and $projection.Compositeserialnumber = _Recursion.MountSerialNumber
{
key BillOfMaterialCategory,
key BillOfMaterial,
key BillOfMaterialItemNodeNumber,
key BOMItemInternalChangeCount,
_BOMEqstEqui.Equipment as Equipment,
_BOMEqstEqui.Material as CompositeMaterial,
_BOMEqstEqui.SerialNumber as Compositeserialnumber,
SerialNumber as MountSerialNumber,
BillOfMaterialComponent,
BatchNumber,
/* Associations */
_BOMEqstEqui,
_ComponentBOMEquip,
_Recursion
}
$node
function to define the hierarchy levels.define hierarchy ZTESTSTPOEQSTEQUIHier1
as parent child hierarchy(
source ZTESTSTPOEQSTEQUI
child to parent association _Recursion
siblings order by
BillOfMaterial ascending,
BillOfMaterialItemNodeNumber ascending
multiple parents allowed
orphans root
)
{
key BillOfMaterialCategory,
key BillOfMaterial,
key BillOfMaterialItemNodeNumber,
key BOMItemInternalChangeCount,
Equipment,
CompositeMaterial,
Compositeserialnumber,
BillOfMaterialComponent,
MountSerialNumber,
BatchNumber,
$node.parent_id as ParentNode,
$node.node_id as ChildNode,
$node.hierarchy_level as HierarchyLevel
}
define view ZTESTSTPOEQSTEQUIHier2
as select from ZTESTSTPOEQSTEQUIHier1
{
key BillOfMaterialCategory,
key BillOfMaterial,
key BillOfMaterialItemNodeNumber,
key BOMItemInternalChangeCount,
Equipment,
CompositeMaterial,
Compositeserialnumber,
BillOfMaterialComponent,
MountSerialNumber,
BatchNumber,
ParentNode,
ChildNode,
HierarchyLevel
}
SELECT *
FROM HIERARCHY_ANCESTORS( SOURCE ZTESTSTPOEQSTEQUIHier1
START WHERE BillOfMaterialComponent = @lv_component
AND MountSerialNumber = @lv_mountserialno
)
INTO TABLE @DATA(lt_ancestors).
BILLOFMATERIALCATEGORY BILLOFMATERIAL BILLOFMATERIALITEMNODENUMBER BOMITEMINTERNALCHANGECOUNT EQUIPMENT COMPOSITEMATERIAL COMPOSITESERIALNUMBER BILLOFMATERIALCOMPONENT MOUNTSERIALNUMBER BATCHNUMBER PARENTNODE CHILDNODE HIERARCHYLEVEL
E 00000805 00000002 00000004 000000000010132848 D261959847-0103 000000000000000195 NX_CONSTIT_FANT_1 000000000000000100 15,D261959847-0103;18,000000000000000195 17,NX_CONSTIT_FANT_1;18,000000000000000100 3
E 00000476 00000004 00000008 000000000010132348 LG_CONSTIT_ZT04 000001231212424683 D261959847-0103 000000000000000195 15,LG_CONSTIT_ZT04;18,000001231212424683 15,D261959847-0103;18,000000000000000195 2
E 00000548 00000004 00000008 000000000010132427 LG_CONSTIT_ZT03 000001231212424749 LG_CONSTIT_ZT04 000001231212424683 15,LG_CONSTIT_ZT03;18,000001231212424749 15,LG_CONSTIT_ZT04;18,000001231212424683 1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |