Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>CostCenterGroup



Index

CostCenterGroup

CostCenterGroup


The object Cost center grouping contains a dividing up of cost
centers from the organizational viewpoint for evaluation purposes or
for the specification of rules of common validity, and the cost center
type as a dividing up cost centers according to their function within the enterprise.


For the dividing up of cost centers cost center groups can be defined.

As cost responsibility areas these groupings are organizational
divisions of the enterprise for which a cost reponsibility is defined
in each case. For integation in the organization each cost center must be assigned to a cost responsibility area.

For the cost responsibility areas a multilevel hierarchy can be defined.

In addition to the cost responsibility areas other cost center groupings can be defined e.g, for evaluation purposes. These in turn
can be grouped together or refined level-by-level through hierarchical
assignments. In these alternative hierarchies cost responsibility areas can also be included.


11-Dec-2005


Methods

Available Methods


  • AddNode : Insert nodes in a cost center group [ BAPI_COSTCENTERGROUP_ADDNODE ]
  • Create : Create cost center group [ BAPI_COSTCENTERGROUP_CREATE ]
  • GetDetail : Read cost center group [ BAPI_COSTCENTERGROUP_GETDETAIL ]
  • GetList : Index of cost center groups [ BAPI_COSTCENTERGROUP_GETLIST ]

11-Dec-2005


AddNode

AddNode


Inserting a new node in a cost center group.

The group SubGroupName is inserted as the last subordinate node in the group GroupName. The controlling area of the groups is entered in the ControllingArea parameter; both groups must already exist.


If an error occurs during insertion, the error message is issues in the Return parameter..

Notes

You require the authorization for object K_CSKA_SET and K_CCA.

You may only change the standard hierarchy compatibly using this method. You may not insert a group that already
contains cost centers.


11-Dec-2005


Create

Create


Creating or changing a cost center group.

All the groups from the table HierarchyNodes are created in the system. The controlling area of thegroups is entered in the ControllingAreaImp parameter; any groups that already exist are overwritten.


Information about the nodes of a hierarchy is transferred to the table HierarchyNodes. This table contains the group names and the description for each node in the hierarchy. The hierarchy structure isportrayed via the order of the nodes in the table and the level of the node in the HIERLEVEL field.


If values or value intervals are assigned to a node, then the entry in the VALCOUNT field shows the number of assigned values or value intervals. These are transfered to the HierarchyValues table in the order in which these appear in the hierarchy.


Example

The group 'GROUP1' has the following structure:

  GROUP1
   |
   |---- GROUP11
   |  |
   |  |---- GROUP111
   |     |
   |     |---- VALUE1
   |
   |---- GROUP12

      |
      |---- VALUE2
      |---- VALUE3 - VALUE9

The HierarchyNodes table thus contains the following entries:

GROUPNAME HIERLEVEL VALCOUNT

GROUP1 0 0


GROUP11 1 0

GROUP111 2 1

GROUP12 1 2

Only the nodes GROUP111 and GROUP12 contain values or intervals, the HierarchyValues table therefore contains the following entries:

VALFROM VALTO


VALUE1 VALUE1

VALUE2 VALUE2

VALUE3 VALUE9

Groups can contain either values or other groups, i.e. only the end nodes of the hierarchy contain values.

If the optional parameter TopNodeOnly is set to 'X', only the
first node in the hierarchy table can be created or changed. In this case the table HierarchyNodes, in addition to these nodes, may only contain level 1 nodes. These nodes must already exist in thesystem, here they are merely attached to the first node. In this way,
for example, an existing large hierarchy can be extended by attaching anew sub-tree without the hierarchy having to be completely recreated.

If an error occurs when you create a group, the error message is issued in the parameter Return.


Notes

You require the authorization for object K_CSKA_SET und K_CCA.

You may only change the standard hierarchy compatibly using this method. You may not move, insert or remove costcenters or sub-trees that contain cost centers.


11-Dec-2005


GetDetail

GetDetail


Reading a cost center group.

The cost center group GroupName from controlling area ControllingArea is read.

If an error occurs during the reading of the group, an error message is issued in the Return parameter.


Information about the nodes of a hierarchy is transferred to the table HierarchyNodes. This table contains the group names and the description for each node in the hierarchy. The hierarchy structure isportrayed via the order of the nodes in the table and the level of the node in the HIERLEVEL field.


If values or value intervals are assigned to a node, then the entry in the VALCOUNT field shows the number of assigned values or value intervals. These are transfered to the HierarchyValues table in the order in which these appear in the hierarchy.


Example

The group 'GROUP1' has the following structure:

  GROUP1
   |
   |---- GROUP11
   |  |
   |  |---- GROUP111
   |     |
   |     |---- VALUE1
   |
   |---- GROUP12

      |
      |---- VALUE2
      |---- VALUE3 - VALUE9

The HierarchyNodes table thus contains the following entries:

GROUPNAME HIERLEVEL VALCOUNT

GROUP1 0 0


GROUP11 1 0

GROUP111 2 1

GROUP12 1 2

Only the nodes GROUP111 and GROUP12 contain values or intervals, the HierarchyValues table therefore contains the following entries:

VALFROM VALTO


VALUE1 VALUE1

VALUE2 VALUE2

VALUE3 VALUE9

Notes

You require the read authorization for object K_CSKA_SET and K_CCA.


11-Dec-2005


GetList

GetList


List of cost center groups. All the cost center groups are searched for that satisfy the selection criteria.

You can restrict the search for groups by transferring a mask for the group name in the optional paramter GroupNameMask (masking indicators are +*).


The controlling area of the groups is entered in the ControllingAreaMask parameter (maskingindicators are also possible here.

If the optional parameter TopNodesOnly is set to 'X', a searchis only made for groups that are the top node in a hierarchy, i.e. they are not used in other groups.


The list of groups found is transfered to the GroupList table.

If an error occurs during the search, the error message is issued in the Return parameter.

Example

All cost centers from controlling area 1000 that begin with 'A' are to be displayed. Call the method:

DATA: LT_GROUPLIST LIKE BAPI1112_LIST OCCURS 0,
      L_RETURN     LIKE BAPIRET2.
CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETLIST'
     EXPORTING
          CONTROLLINGAREAMASK = '1000'
          GROUPNAMEMASK       = 'A*'

     IMPORTING
          RETURN              = L_RETURN
     TABLES
          GROUPLIST           = LT_GROUPLIST.

Notes

You require the read authorization for object K_CSKS_SET


11-Dec-2005