Fonction SAP BAPI_HIERA_GETSUPERSTRUCTURE - Class Hierarchy BAPI: Read Hierarchy (Bottom Up)

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CLASSNUM BAPI1003_KEY-CLASSNUM C 18 Class
CLASSTYPE BAPI1003_KEY-CLASSTYPE C 3 Class Type
KEYDATE BAPI1003_KEY-KEYDATE D 8 SY-DATUM X Valid-From Date
WITH_DESCRIPTION BAPI1003_KEY-FLAG C 1 'X' X Determine Language-Dependent Description

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

Functionality
This BAPI returns all classes that have the instance as a superiorclass, with the relationships of classes to each other.
The instance is defined by the fields 'ClassNum' and 'ClassType'. Youcan also transfer a date ('KeyDate').
Table 'SupertreeList' contains the hierarchy structure. The subordinateclasses of each class are stored in this table (the class is in field'ClassName' and the subordinate class in field 'ChildName'). Field'Level' contains the hierarchy level. Root classes have level 1, andthe level of any class is the level of its superior class plus 1. (If aclass has more than one superior class, the level refers to thesuperior class without the 'Link' indicator.) If a class has severalsubordinate classes, the entry is repeated for all fields except'ChildName', which contains a different subordinate class.
The 'Link' indicator is for hierarchies with multiple classification. Aclass has several superior classes directly above it. Each superiorclass has an entry where field 'ChildName' contains the classifiedclass. However, all but one of these entries has the 'Link' indicatorset.
Field 'Status' contains the status of the assignment of the class in'ChildName' to the class in 'ClassName'. Field 'Description' containsthe language-dependent description in the logon language.

Example
Class6 is the instance. The complete hierarchy looks like this:
Class1 is assigned to Class0
Class1 is assigned to Class9
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
Class4, Class7, and Class8 are outside the relevant section of thehierarchy, because they are neither directly nor indirectly superior tothe instance. Class0 is the root class. Class9 is another root class,due to multiple classification. Class6 is assigned to more than oneclass in the hierarchy path. Class4 is assigned to more than one classoutside the hierarchy path. This means that table 'SubtreeList' is asfollows:
ClassName,,Level,,Link,,ChildName
Class0,,1,,,,Class1
Class1,,2,,,,Class2
Class1,,2,,,,Class3
Class2,,3,,,,Class6
Class3,,3,,X,,Class6
Class6,,4
Class9,,1,,X,,Class1

Notes
The output of this BAPI is not a complete section of the hierarchy. Theinstance never has an entry in field 'ChildName', but this does notmean that it has no subordinate classes. Also, not all subordinateclasses of other classes are returned. Only the superior classes arelisted.
Multiple classification allows you to access all subordinate classes ofa class (if output by this BAPI), but not all of its superior classes.Check whether there are entries with 'ChildName' = class and 'Link' ='X'.
Hierarchy level 1 refers to the root class, not the instance. Thehighest level output belongs to an entry for the instance, but theremay be other entries for the instance, due to multiple classification.This means that you cannot identify the instance by field 'Level', butby the blank 'ChildName' field.
If a class is classified in several classes, its hierarchy level refersto the class where the classified class occurs in field 'ChildName'without the 'Link' indicator.
For entries with the 'Link' indicator set, the level of the subordinateclass may not be 1 higher than the level of the superior class. Youneed to take this into account when navigating.
The sequence of entries in table 'SupertreeList' is not relevant.

Further information
This BAPI does not return characteristics or characteristic values ofclasses in the hierarchy. To do this, use BAPI Class.GetDetailSubclass.

Description
Class

Description
Class type

Description
Valid-from date

Default
System date

Description
Return parameters

Description
Class hierarchy