Sapass

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



Index

ExpenditureProgTree

ExpenditureProgTree


The business object program sub-tree is a part of a program. A
program can be made up of a number of program sub-trees. The program
definition, approval year, and point of entry position uniquely identify the program-sub-tree.


Structure


A program sub-tree can consist of a number of positions that are linked
to a hierarchical structure. Any criteria can be used as the structuring criteria for the sub-tree (such as, organizational units,
scale of the assigned measure, and so on), the same as for the program
itself. The positions of the program sub-tree can group together several Controlling objects, for which the position carries the
umbrella budget and plan values.


Example


The program "Overall Investments 1998" consists of the following program sub-trees:


  • Business Area Household Appliances

  • Business Area Household Appliances-- Southern Region

  • Business Area Household Appliances-- Northern Region

  • Business Area Electronic Entertainment--- Southern Sales District

  • Business Area Electronic Entertainment--- Northern Sales District

  • 11-Dec-2005


    Methods

    Available Methods


    • Change : Change [ BAPI_EXPENDITUREPROGTREE_CHG ]
    • ChangeValues : Change Values (Plan, Budget) [ BAPI_EXPENDITUREPROGTREE_CHVAL ]
    • Create : Create [ BAPI_EXPENDITUREPROGTREE_CREAT ]
    • Delete : Delete [ BAPI_EXPENDITUREPROGTREE_DEL ]
    • DeleteValues : Delete Values (Plan, Budget) [ BAPI_EXPENDITUREPROGTREE_DLVAL ]
    • ExistenceCheck : Existence check [ BAPI_EXPENDITUREPROGTREE_EXCHK ]
    • GetDetail : Display [ BAPI_EXPENDITUREPROGTREE_GTDTL ]
    • GetDetailValues : Display Values (Plan, Budget, Actual, Commitment) [ BAPI_EXPENDITUREPROGTREE_GDVAL ]
    • GetStatus : Display System/User Status [ BAPI_EXPENDITUREPROGTREE_GTSTA ]
    • Reassign : Reassign [ BAPI_EXPENDITUREPROGTREE_REASS ]
    • SaveReplica : SaveReplica - SAP internal use only [ BAPI_EXPENDITUREPROGTREE_SVRP ]
    • SaveReplicaValues : SaveReplicaValues - SAP internal use only [ BAPI_EXPENDITUREPROGTREE_SVRPV ]
    • SetStatus : Change System/User Status [ BAPI_EXPENDITUREPROGTREE_STSTA ]

    11-Dec-2005


    Change

    Change


    Function

    Using this method, you can change the master data of program positionsof the sub-tree entered. It is not possible to change the hierarchy of the sub-tree itself.

    The system only considers those fields that have different entries.That is, you only have to enter the field to be changed in the table
    records of the sub-tree position, while the other fields remain empty.

    Before making the change to the program positions, the system automatically checks the consistency of the data in the local andexternal systems. If there are no errors, the changes are made. The system changes either all positions or no positions.


    Set the TEST_RUN indicator to have the system check if changing the data is possiblewithout errors. You receive a list showing any errors. In this way, youavoid the situation in which multiple errors cause the change of datato be interruped each time. The change itself is not made when this indicator is set.


    Notes

    You specify the subtree by entering these parameters:

  • PROGRAM
  • APPROVALYEAR
  • POSITION
  • The transfer of the data to be changed takes place using the PROGPOS_OLD and PROGPOS_NEW tables.
    PROGPOS_OLD contains the unchanged data, as it was in the externalsystem before the change. Table PROGPOS_NEW contains the changed data.

    During the consistency check, the unchanged data of the fields to bechanged contained in the PROGPOS_OLD table is compared with the data in
    the local system. The change is allowed only if the data is the same.

    The PROGPOS_OLD and PROGPOS_NEW tables only need to contain the programpositions that are to be changed. It is not necessary to transfer thecomplete sub-tree with all of its positions. The sequence of the positions to be changed within the tables does not matter, but the
    positions have to belong to the sub-tree entered.


    11-Dec-2005


    ChangeValues

    ChangeValues


    Function

    You can use this method to change the budget or plan values on the positions of a program sub-tree.

    Notes

    Using this method, the system transfers the value changes (= "deltas") for each position in table PROGTREEVALUES, not
    the new values resulting from the change.


    11-Dec-2005


    Create

    Create


    Function

    Using this method, you can create a program sub-tree in the programentered. The program definition has to exist already in the system inwhich the sub-tree is being created. You can either create a separate program tree, or add a sub-tree to an existing program tree.

    Set the TEST_RUN indicator to have the system check if creating the sub-tree is possiblewithout errors. You receive a list showing any errors. In this way, youavoid the situation in which multiple errors cause the creation of thesub-tree to be interruped each time. The sub-tree is not created when this indicator is set.


    Notes

    You specify the program by entering these parameters:

  • PROGRAM
  • APPROVALYEAR
  • You control the position, to which the sub-tree should be assigned, using the PARENT and PREDECESSOR fields.

    The program positions are transferred in the PROGTREE internal
    table. Along with the master data, this table has to supply the hierarchy of the sub-tree.

    Notes

    The system returns the master data of the positions of a program sub-tree in the internal table PROGTREE.

    The hierarchy of a program sub-tree is uniquely identified by the hierarchy levels of its positions (LEVEL field of the
    table) and the sequence of the table records. Lower-level positionsfollow directly in sequence after the program position to which theyare subordinate, with the number of their hierarchy level increased byone. Once all positions that belong to a hierarchy level are entered,
    the sequence continues with the next position of the next higher level hierarchy level.

    Example

    The highest position of a sub-tree is called TOP, and it has twolower-level positions A and B. Position A has two further lower-levelpositions called A.1 and A.2. The table has the following structure:


    LEVEL ... POSID ...
    01 TOP remaining fields of position TOP
    02 A remaining fields of position A
    03 A.1 remaining fields of position A.1
    03 A.2 remaining fields of position A.2
    02 B remaining fields of position B


    The following is particularly important for the records of the table:

  • Only two-character numerical symbols of type NUMC are allowed for the hierarchy levels.
  • The first entry in the table has to contain the top position of the
    sub-tree. The top position has hierarchy level '01' (LEVEL = '01').
  • You can enter only one top position. That is, you can currently workwith only one sub-tree. Therefore, hierarchy level '01' can exist only once in the table.

  • Hierarchy levels smaller than '01' are not allowed.
  • The hierarchy level is allowed to increase by a maximum of +1 betweenone position in the table and the position that follows it in thetable. Decreasing the hierarchy level, on the other hand, can take place in any increments (down to the lowest allowed value '01').

  • 11-Dec-2005


    Delete

    Delete


    Function

    This method deletes the program sub-tree with its point of entry position.

    If the TEST_RUN indicator is set, the system checks whether or not deletion is possible. The data itself remains in this session.


    11-Dec-2005


    DeleteValues

    DeleteValues


    Function

    This method deletes the budget/plan values of all positions of a program sub-tree.

    You control which values are deleted by setting the appropriateindicators. The indicators are not mutually exclusive, that is you can set them in any combination.


    11-Dec-2005


    ExistenceCheck

    ExistenceCheck


    Function

    The methode checks if there is a program sub-tree in the system with the entered point of entry position.


    11-Dec-2005


    GetDetail

    GetDetail


    Function

    This method returns the master data of positions of a program sub-tree.

    In addition, it also provides the hierarchy relationships between the individual positions within the sub-tree.

    Notes

    The system returns the master data of the positions of a program sub-tree in the internal table PROGTREE.


    The hierarchy of a program sub-tree is uniquely identified by the hierarchy levels of its positions (LEVEL field of thetable) and the sequence of the table records. Lower-level positionsfollow directly in sequence after the program position to which they
    are subordinate, with the number of their hierarchy level increased byone. Once all positions that belong to a hierarchy level are entered,the sequence continues with the next position of the next higher level hierarchy level.

    Example

    The highest position of a sub-tree is called TOP, and it has two
    lower-level positions A and B. Position A has two further lower-levelpositions called A.1 and A.2. The table has the following structure:

    LEVEL ... POSID ...
    01 TOP remaining fields of position TOP
    02 A remaining fields of position A
    03 A.1 remaining fields of position A.1

    03 A.2 remaining fields of position A.2
    02 B remaining fields of position B

    The following is particularly important for the records of the table:

  • Only two-character numerical symbols of type NUMC are allowed for the hierarchy levels.

  • The first entry in the table has to contain the top position of thesub-tree. The top position has hierarchy level '01' (LEVEL = '01').
  • You can enter only one top position. That is, you can currently workwith only one sub-tree. Therefore, hierarchy level '01' can exist only once in the table.

  • Hierarchy levels smaller than '01' are not allowed.
  • The hierarchy level is allowed to increase by a maximum of +1 betweenone position in the table and the position that follows it in thetable. Decreasing the hierarchy level, on the other hand, can take place in any increments (down to the lowest allowed value '01').

  • 11-Dec-2005


    GetDetailValues

    GetDetailValues


    Function

    This method is used to determine plan values, budget values, actualvalues and commitments for the positions of a program sub-tree.

    Notes

    The standard output of the method are the current plan and budgetvalues of the program positions. By setting additional indicators, you can also receive the following values:


    1. READ_CARRY_FORWARD_VALUES_ALSO = X
      1. During calculation of the plan and budget values of program positions,carryforward values are also taken into account.
      2. During calculation of the plan, budget, actual and commitment values of
        measures or appropriation requests, the measure values that werecarried forward are also taken into account (if requested; see below).
    2. READ_FUTURE_VALUES_ALSO = X
      During calculation of plan and budget values of program positions,
      values from the forecast are also taken into account.
    3. READ_MEASURE_PLAN_ALSO = X
      The plan values from measures and appropriation requests are also readand displayed on the program positions (in summarized form).
    4. READ_MEASURE_BUDGET_ALSO = X
      The budgets of measures and measures for appropriation requests are
      read and displayed on the program positions (in summarized form).
    5. READ_MEASURE_ACTUALS_ALSO = X
      The actual values and commitments of measures and measures forappropriation requests are read and displayed on the program positions (in summarized form).

    11-Dec-2005


    GetStatus

    GetStatus


    Function

    This methode returns the active system status and user status of all positions of a program sub-tree.

    Notes

    For each position of the sub-tree, the method converts the internal,language-independent, individual statuses into their external,
    language-dependent format and summarizes them in a common text row. Youcan enter the language, in which the status should be returned, as a parameter.


    11-Dec-2005


    Reassign

    Reassign


    Function

    Using this method, you can reassign the program sub-tree to a point ofentry position you enter. You can reassign sub-trees only within thetree to which they belong. It is not possible, for example, for thesub-tree to become a separate tree with the point of entry position as its top position.


    When you reassign a sub-tree that has positions that already havebudget or plan values, the method automatically ensures that these values are transferred consistently within the tree.

    If you set the TEST_RUN indicator, the system checks if the sub-tree can be reassigned
    without errors. However, the sub-tree is not reassigned.

    Notes

    You control the position, to which the sub-tree should be assigned, using these fields:

  • PARENT_NEW
  • PREDECESSOR_NEW
  • The consistent transfer and correlation of the values of the sub-tree
    with the values of those positions that already have plan or budgetvalues is ensured as described below. Assume the following scenario:

    X is the top position of the sub-tree being reassigned, and X hasposition A as the next position directly above it in the hierarchy
    before the reassignment. After the reassignment, the position directlyabove X in the hierarchy is B. Then the following takes place:

  • The budget/plan values of A and all higher-level positions in the hierarchy anbove A are reduced by the budget/plan value of X.
  • The budget/plan values of B and all higher-level positions in the hierarchy above B are increased by the budget/plan value of X.
  • This reduction/increase of budget/plan values takes place up to the first higher-level position that is common to both A and B.

    The new parent position, to which the sub-tree is supposed to bereassigned, is not permitted to have measures. Measures are onlyallowed on end node positions. If the new parent position was an endnode position before the reassignment, then it is no longer an end node after the reassignment.


    If the TEST_RUN indicator is set, the system merely tests if the sub-tree can be reassigned without errors.


    11-Dec-2005


    SaveReplica

    SaveReplica


    No document is available


    11-Dec-2005


    SaveReplicaValues

    SaveReplicaValues


    Intended for intenal use only.

    Do not use!


    11-Dec-2005


    SetStatus

    SetStatus


    Function

    Using this method, you can change the system status and user status of the positions of a program sub-tree.

    Notes

    The changes to system status are transferred in table SYSTEM_STATUS. The changes to user status are transferred in table
    USER_STATUS.

    In these tables, you only need to enter those program positions of thesub-tree, for which a status change should actually be carried out. Youdo not have to transfer the complete sub-tree with all of itspositions. The sequence in the table of the positions to be changed is
    also not important, however, the positions have to belong to the sub-tree entered.

    Since the system status and user status can each influence the other,you can specify which status should be set first, using the USER_STATUS_FIRST indicator.


    11-Dec-2005