Fonction SAP BAPI_HIERA_GETSUBSTRUCTURE - Class Hierarchy BAPI: Read Hierarchy (Top Down)

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CLASSNUM BAPI1003_KEY-CLASSNUM C 18 Class Number
CLASSTYPE BAPI1003_KEY-CLASSTYPE C 3 Class Type
HIERARCHYDEPTH BAPI_MAX_HITS-MAX_HITS I 4 X Maximum Number of Hierarchy Levels
KEYDATE BAPI1003_KEY-KEYDATE D 8 SY-DATUM X Valid-From Date
WITH_DESCRIPTION BAPI1003_KEY-FLAG C 1 'X' X Read Language-Dependent Description

Paramètre Reférence Long. Facultatif Description
RETURN BAPIRET2 548 Return Parameters
SUBSTRUCLIST BAPI1003_TREE 116 Representation of Class Hierarchy

Functionality
This BAPI returns all classes that have the instance as a superiorclass, and the relationships of the classes to each other. Superiorclasses of classes in the hierarchy are excluded, unless they also havethe instance as a superior class.
The instance is defined by fields 'ClassNum' and 'ClassType'. You canalso transfer a date ('KeyDate'). You can use the 'HierarchyDepth'parameter to determine how many levels of the hierarchy are read. Thedefault is to explode the entire hierarchy below the instance.
The hierarchy structure is in table 'SubstrucList'. This table containsthe subordinate class of each class (the class is in field 'ClassName'and the subordinate class in field 'ChildName'). Field 'Level' containsthe hierarchy level. The instance has level 1, and the level of eachclass is the level of its superior class plus 1. (If a class has morethan one superior class, the level refers to the superior class whoseentry has no 'Link' indicator.) If a class has more than onesubordinate class, the entry is repeated for all fields except field'ChildName', which contains a different subordinate class.
The 'Link' indicator is for multiple classification in the hierarchy,where one class has more than one superior classes immediately aboveit. Each of these superior classes has an entry, with the class thathas multiple assignments in field 'ChildName'. However, all but one ofthese entries has the 'Link' indicator set.
The 'Status' field contains the status of the assignment of the classin field 'ChildName' to the class in field 'ClassName'.
If the class has no subordinate classes, table 'SubstrucList' containsexactly one entry for the instance, with the 'ChildName' field blank.

Example
Class1 is the instance. The entire hierarchy has the followingstructure:
Class1 is assigned to Class0
Class9 is assigned to Class0
Class10 is assigned to Class0
Class2 is assigned to Class1
Class3 is assigned to Class1
Class4 is assigned to Class1
Class4 is assigned to Class9
Class5 is assigned to Class2
Class6 is assigned to Class2
Class6 is assigned to Class3
Class7 is assigned to Class6
Class8 is assigned to Class6
Class0, Class9, and Class10 are outside the section of the hierarchythat is relevant, because they are neither directly nor indirectlyassigned to the instance. Class1 is the root, Class9 is another root,due to multiple classification. Class6 is assigned to several classesin the hierarchy. Class4 is assigned to several classes outside thehierarchy. Class4, Class5, Class7, and Class8 are end nodes. This meansthat table 'SubstrucLis' is as follows:
ClassName,,Level,,Link,,ChildName
Class1,,1,,,,Class2
Class1,,1,,,,Class3
Class1,,1,,,,Class4
Class2,,2,,,,Class5
Class2,,2,,,,Class6
Class3,,2,,X,,Class6
Class4,,2
Class5,,3
Class6,,3,,,,Class7
Class6,,3,,,,Class8
Class7,,4
Class8,,4

Notes
The instance is the only root and has level 'Level' = 1.
If the 'HierarchyDepth' parameter is blank, exactly those classes thathave no entry for 'ChildName' are end nodes of the hierarchy. If thisparameter is set, the result may be a section of the hierarchy whereend nodes have a class in the 'ChildName' field that does not occur inthe 'ClassName' field of another entry. The processing logic can copewith this situation, but the original rule still applies to actual endnodes.
Multiple classification means that you can access all subordinateclasses of a class, but not all their superior classes. Check forentries with 'ChildName' = class.
If a class is classified in multiple classes, the hierarchy levelrefers to the class that has the classified class as a subordinateclass without the 'Link' indicator. This means that, for entries with a'Link' indicator set, the level of the subordinate class need not be 1higher than that of the superior class. You must take account of thiswhen navigating.
The sequence of entries in table 'SubstrucLis' is not relevant.

Further information
This BAPI does not return characteristics or characteristic values forclasses in the hierarchy. BAPI Class.GetDetailSubclass is available forthis purpose.
If you are only looking for one hierarchy path between a superior classyou know and a subordinate class you know, it is better to use BAPIClass.GetSuperstructure, with the subordinate class as the instance.This improves system performance considerably and returns far lesssuperfluous information.

Description
Class

Description
Class type

Description
Valid-from date

Default
System date

Description
Return parameters

Description
Representation of class hierarchy