Fonction SAP BAPI_COSTOBJNODE_GETHIERARCHY - Determine Cost Object Hierarchy

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
TREE_COMPONENT BAPI2076_COMP u 140 Hierarchy Node

Paramètre Reférence Type Long. Description
RETURN BAPIRETURN1 u 470 Confirmations

Paramètre Reférence Long. Facultatif Description
COSTOBJECT_TREE BAPI2076_TREE 156 Cost Object Hierarchy

Functionality
The method CostObjectNode.GetHierarchy determines the hierarchyfor a hierarchy node.

Notes
Authorization object K_CKPH - cost object category
is checked with activity 03 (display).
The method CostObjectNode.GetList gives you a list of all costobject nodes in a controlling area.
INCLUDE BAPI_RET

Further information
For more information, refer to the SAP Library under CO - CostObject Controlling.

Description
INCLUDE BAPI_TABLE

Value range
Type,,ID Number,,Message
E,,KZ 053,,Cost object & logically deleted
E,,KZ 176,,Object & not assigned to any hierarchy
E,,KZ 023,,System error: Cost object hierarchy
,, ,,contains a loop
E,,KZ 076,,System error: Parent cost object &
,, ,,does not exist
E,,KZ 022,,Cost object not linked to complete
,, ,,hierarchy
E,,KZ 002,,Cost object &1 does not exist
E,,KZ 701,,Product group &1 does not exist
E,,KZ 088,,&1 is not a cost object of the expected
,, ,,cost object type.
E,,KZ 089,,&1 is not a CO product group

Default

Description
The parameters for the method CostObjectNode.GetHierarchy aretransferred into structure TREE_COMPONENT. They can transfereither a cost object node or a single object.

Structure
COSTOBJECT,,Cost object node,,
MATERIAL,,Material,,
PLANT,,Plant,,
PROCUREMENTPROCESS,,Procurement process,,
ORDERID,,Order number,,

Description
The cost object node andthe single objects in a costobject hierarchy are returned in table COSTOBJECT_TREE.
A table entry is uniquely identified by the field LINEID andcontains either a cost object node or an assigned single object.
The hierarchy and the assignment of the single objects to the lowestnodes can be restored by the field LINEID_PARENT.
A zero (0) designates the root (highest node) of the hierarchy.
The fields LINEID_FIRST_SON and LINEID_NEXT_BROTHERfacilitate navigation in the hierarchy. The sequence within a hierarchylevel is random and has no business significance.

Structure of the Table
LINEID,,Table entry number,,
LINEID_PARENT,,Table entry number of the parent cost object node
LINEID_FIRST_SON,,Table entry number of the first son,,
,,hierarchy object,,
LINEID_NEXT_BROTHER,,Table line number of the next hierarchy,,
,,object with the same parent cost object node,,
COSTOBJECT,,Cost object node,,
MATERIAL,,Material,,
PLANT,,Plant,,
PROCUREMENTPROCESS,,Procurement process,,
ORDERID,,Order number,,