Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> UserExit>AAIP0001



Index

AAIP0001

User Exits for SAPDBIMA (LDB IMA)
Background

If capital investment programs are managed using budget categories, the actual values accumulated on subordinate measures must also be assigned to a budget category so that they can be correctly represented in relation to the program budget/program plan in reporting.

As a default, actual values area are divided up into

  • costs to be capitalized and
  • incidental costs not requiring capitalization

The first kind of costs can be capitalized immediately based on the settings in Customizing.

If, however, you would like instead to assign actual values to budget categories which you have defined yourself, then you must make this assignment using the SAP enhancement AAIP0001.

Activating and programming the SAP enhancement AAIP0001

Proceed as follows:

  • Include the SAP enhancement AAIP0001 in an enhancement project.

To do this, use the function Project management of SAP enhancements (CMOD).

  • Create the ABAP program ZXBIMU01 as an INCLUDE program.
  • Program the assignment of actual values to budget categories in the program ZXBIMU01.
  • Generate the program SAPLXBIM.
Parameters

The following parameters are available in program ZXBIMU01:

  • Field string I_IMTP.

The record has the structure of the dictionary table IMTP.
It contains the definition of the capital investment program (header).

  • Table T_RAIMACT.

The table records have the structure of the dictionary structure RAIMACT.
The table contains the (aggregate) actual values for a measure. The fields of a record in T_RAIMACT have the following significance:

  • OBJNR = CO object number for the measure
  • ABRKZ = settlement indicator

00 - actual value which has not yet been settled
01 - settled to asset
02 - settled to cost center

  • IPPOS = budget category

The setting of the budget category is the task you have to program for assigning actual values to this budget category!

  • WRTTP = value type

The following value types are valid:
04 - actual
11 - statistical actual
21 - commitments from puchase requisition
22 - purchase order commitment
23 - commitments from material reservation
24 - manual commitment
25 - remaining plan for order
26 - fixed price commitment

  • KSTAR = cost element
  • GJAHR = fiscal year
  • TWAER = transaction currency
  • WTG = amount in transaction currency
  • WKG = amount in controlling area currency
Example 1

Assume that we have defined any number of budget categories. When you assign measures to program positions, each measure is divided into the budget categories on the basis of a percentage. The dividing of the actual values should now take place on the the basis of these percentages.

Include ZXBIMU01 should then look like this example (the lines that are so marked should only be implemented in maintenance levels 3.0C/3.0D):

*---------------------------------------------------------------------*
*   INCLUDE ZXBIMU01                                                  *
*---------------------------------------------------------------------*
DATA: T_RAIMACT_TMP LIKE RAIMACT
      OCCURS 0 WITH HEADER LINE.
 
DATA: T_IMZO        LIKE IMZO                    " 3.0C/D only
      OCCURS 0 WITH HEADER LINE.                 " 3.0C/D only
TABLES: IMZO.                                    " 3.0C/D only
 
READ TABLE T_RAIMACT INDEX 1.                    " 3.0C/D only
IF SY-SUBRC <> 0. EXIT. ENDIF.                   " 3.0C/D only
REFRESH: T_IMZO.                                 " 3.0C/D only
SELECT IPPOS BAPRZ FROM IMZO                     " 3.0C/D only
  INTO CORRESPONDING FIELDS OF TABLE T_IMZO      " 3.0C/D only
  WHERE OBJNR = T_RAIMACT-OBJNR.                 " 3.0C/D only
 
T_RAIMACT_TMP[] = T_RAIMACT[].
 
REFRESH T_RAIMACT.


 
DELETE T_RAIMACT_TMP
  WHERE ABRKZ NE '00'.
 
LOOP AT T_RAIMACT_TMP.
  LOOP AT T_IMZO.
    CLEAR T_RAIMACT.
    T_RAIMACT       = T_RAIMACT_TMP.
    T_RAIMACT-IPPOS = T_IMZO-IPPOS.
    T_RAIMACT-WKG   = T_RAIMACT-WKG * T_IMZO-BAPRZ / 100.
    T_RAIMACT-WTG   = T_RAIMACT-WTG * T_IMZO-BAPRZ / 100.
    APPEND T_RAIMACT.
  ENDLOOP.
ENDLOOP.

Caution: The assignment of actual values to budget categories that was made in Example 1 cannot be shown in reports at the level of the program position using the "Hierarchy List" (program RAIMINFO). You have to define drill-down reports for this purpose instead.

Example 2

Assuming that two budget categories have been defined in order to have separate budgets for external and internal activities:

  • EXTLAB = external activities
  • INTLAB = internal activites

Internal activities are denoted by a special cost element: 0000412000

Costs already settled to the measure should not reduce the actual values in reporting!

The INCLUDE ZXBIMU01 should look like this in this case:

 
*---------------------------------------------------------------------*
*   INCLUDE ZXBIMU01                                                  *
*---------------------------------------------------------------------*
 
*  ignore settlements
DELETE T_RAIMACT
  WHERE ABRKZ NE '00'.
 
LOOP AT T_RAIMACT.
*  decide wether internal or external labor
*  and set corresponding budget type
   IF T_RAIMACT-KSTAR EQ '0000412000'.

Function/Program:
  • EXIT_SAPDBIMA_001: Assignment of Actual Values to Budget Categories

02-Oct-2005