Sapass

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



Index

ProfitCenterGroup

ProfitCenterGroup


No description is available


11-Dec-2005


Methods

Available Methods


  • Addnode : Add Node to a Profit Center Group [ BAPI_PROFITCENTERGRP_ADDNODE ]
  • Create : Create Profit Center Group [ BAPI_PROFITCENTERGRP_CREATE ]
  • GetDetail : Read Profit Center Group [ BAPI_PROFITCENTERGRP_GETDETAIL ]
  • Getlist : List of Profit Center Groups [ BAPI_PROFITCENTERGRP_GETLIST ]

11-Dec-2005


Addnode

Addnode


Description

Inserting a new node in a profit center group.

Insert the SubGroupName group as the last subordinate node in the GroupName group. Specify thecontrolling area of the groups in the ControllingArea parameter. Both groups must already exist.


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

Notes

You need the authorization for the object K_PCAP_SET.

The standard hierarchy may only be changed compatibly using this
method. You cannot insert a group that already contains profit centers.


11-Dec-2005


Create

Create


Description

Creating or changing a profit center group.

All the groups from the HierarchyNodes tables are created in the system. The controlling area of thegroups are specified in the ControllingAreaImp parameter. Any existing groups 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 need the authorization ofr the object K_PCAP_SET.

The standard hierarchy may only be changed compatibly using thismethod. You may not move, insert or remove profit centers, or insert or remove subtrees that contain profit centers.


11-Dec-2005


GetDetail

GetDetail


Description

Reading a profit center group.

The profit center group GroupName from the controlling area ControllingArea is read.

If an error occurs when reading the group, the error message is output 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 need the read authorization for the object K_PCAP_SET.


11-Dec-2005


Getlist

Getlist


Description

List of profit center groups.

All the profit center groups that fulfill the specified selection criteria are searched for.

The search for groups can be restricted by entering a mask for the group name (mask characters are +*) in the optional
GroupNameMask
parameter.

The controlling area of the groups are specified in the ControllingAreaMask parameter. Youcan use mask characters here too.

If the optional TopNodesOnly parameter is set to 'X', only those
groups that are the top nodes in a hierarchy (are not used in other groups) are searched for.

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

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


Example

All the profit center groups from controlling area 1000 that begin with 'A' are to be output. Method call:

DATA: LT_GROUPLIST LIKE BAPI1112_LIST OCCURS 0,
      L_RETURN     LIKE BAPIRET2.
CALL FUNCTION 'BAPI_PROFITCENTERGROUP_GETLIST'

     EXPORTING
          CONTROLLINGAREAMASK = '1000'
          GROUPNAMEMASK       = 'A*'
     IMPORTING
          RETURN              = L_RETURN
     TABLES
          GROUPLIST           = LT_GROUPLIST.


Notes

You need the read authorization for the object K_PCAP_SET


11-Dec-2005