We're attempting to use the HIERARCHY function in HANA to speed up the BOM explosion process that is currently being done in ABAP. The base query works, but we're trying to refine it more for the end-user. The goal is we want to normalize the assemblies and display a grandparent-parent-child relationship in the output so that every root node will display all sub-components below it before moving on to the next assembly in the output. This is my first post here, so if I need to add any code or further clarify I'd be happy to.
CREATE COLUMN TABLE "BOM_EXPLOSION" ("HIERARCHY_TREE_SIZE" NVARCHAR(10),
"PARENT_ID" NVARCHAR(15),
"NODE_ID" NVARCHAR(15),
"QUANTITY" NVARCHAR(10),
"VALID_FROM" NVARCHAR(10),
"VALID_TO" NVARCHAR(10)) UNLOAD PRIORITY 5 AUTO MERGE
insert into "BOM_EXPLOSION" values('6','X-000-XXX-01','Y-000-XXX-S1','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S1','COMP1','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S1','COMP2','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S1','COMP3','2','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S1','COMP4','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S1','COMP5','2','20171221','99991231');
insert into "BOM_EXPLOSION" values('4','X-000-XXX-01','Y-000-XXX-S2','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S2','COMP1','2','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S2','COMP2','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','Y-000-XXX-S2','COMP3','1','20171221','99991231');
insert into "BOM_EXPLOSION" values('1','X-000-XXX-01','COMP4','1','20170530','20171221');


CREATE TABLEandINSERTcommands. That way we can actually work with it.