User Exits for SAPDBIMA (LDB IMA)
Background Standard reports for investment programs deal primarily with budget values, planned values and assigned values. It is also possible to define drilldown reports in which you define different mathematical combinations of these value fields.
If you wish your reports to display additional value fields that are not covered by the standard functions just described, then use SAP enhancement AAIP0002 for this purpose. This enhancement can only be used in drilldown reports for: - Reports on the investment program
(see F4 help for transaction IME0) - Reports using the summarization database
(see F4 help for transaction IMC0) You should also carry out the related ehancement AAIR0001 if you are using: - Reports on appropriation requests
(see F4 help for transaction IMD0). Activating and Programming SAP Enhancement AAIP0002 Follow these steps: - Define names (= fixed values) and short descriptions for the desired user value fields.
Maintain the fixed values of domain IM_USERVAL in the ABAP Dictionary
(transaction SE11). Enter an identification code (maximum of 4 characters) and a short description for each user value field. - Include SAP enhancement AAIP0002 in an enhancement project (with any key).
For this, use the function Project management of SAP enhancements (transaction CMOD).
- Create ABAP program ZXBIMU02 as include program.
- In program ZXBIMU02, program providing of values to the user-defined value fields.
The code for this include will run exactly once for each investment program position, measure and appropriation request.
- Generate program SAPLXBIM.
After following these preliminary steps, you can now evaluate the newly defined value field directly using the genral value list in IM reporting. In addition, you can define your own drilldown reports that
evaluate the new user value field. In order to do so, define forms in which you specify the characteristic "ID for user value field" in the appropriate cells. Parameters The following parameters are available in program ZXBIMU02:
The object type describes the object that is currently being processed: - ID = investment program definition
- IP = investment program position
- OR = order
- PR = WBS element
- IQ = appropriation request
Structure I_IMTP. The record has the structure of Dictionary table IMTP. The record contains fields for the definition of the investment program. The record has the structure of Dictionary table IMPR.
The record contains fields for the investment program positions. If a measure (I_OBART = OR or PR) or appropriation request (I_OBART = IQ) is currently being processed rather than a program position (I_OBART = IP), then I_IMPR describes the program position to which the measure or appropriation request is attached.
The record has the structure of Dictionary table AUFKV. The record contains fields for the current order (but only if I_OBART = OR). The record has the structure of Dictionary table PRPS.
The record contains fields for the current WBS element (but only if I_OBART = PR). The record has the structure of Dictionary table PROJ. The record contains fields for the project definition of the current WBS element (but only if I_OBART = PR).
The record has the structure of Dictionary table IMAK. The record contains fields for the current appropriation request (but only if I_OBART = IQ). - Indicator I_FLAG_MEAS_OF_REQ
For appropriation requests, the program also runs through all measures
assigned to the appropriation request that have I_OBART = OR or I_OBART = PR. Using the indicator I_FLAG_MEAS_OF_REQ, the system can now also distinguish between: - Measures that are directly assigned to an investment program position (I_FLAG_MEAS_OF_REQ is blank)
- Measures that are assigned to an appropriation request, which is in turn assigned to an investment program position (I_FLAG_MEAS_OF_REQ = X)
Table I_RIMAKPGES. The table contains the records of the structure of Dictionary table RIMAKPGES.
The table contains the percentage distributions of the current appropriation request (but only if I_OBART = IQ). The records in the table have the structure of Dictionary structure RAIMACT. The table contains the (summarized) actual values. The fields of a record from T_RAIMACT mean the following:
- OBJNR = CO object number
- ABRKZ = settlement indicator
00 - actual value that is not yet settled 01 - settled to an asset 02 - settled to a cost center - IPPOS = budget category
- WRTTP = value type
- KSTAR = cost element
- GJAHR = fiscal year
- WKG = amount in controlling area currency
Table I_BPGE The records of the table have the structure of Dictionary table BPGE. The table contains the (summarized) overall budget values. The fields
of a record from T_BPGE mean the following (selected fields shown): - OBJNR = CO object number
- TRGKZ = object indicator, indicates if values are "current", "balance forward" or "forecast"
N - current B - balance forward C - forecast
The object indicators B and C (balance forward and forecast) occur only in investment program positions (I_OBART = IP)! 01 = plan (measure) 41 = budget (measure) 48 = plan (program position)
47 = budget (program position) 39 = plan (appropriation request) - VORGA = activity (original, supplement, return, ... )
- WLGES = value in controlling area currency
- WLGEV = distributed value in controlling area currency
Table I_BPJA The records of the table have the structure of Dictionary table BPJA. The table contains the (summarized) annual budget values. The fields of table T_BPJA correspond almost exactly to those of table T_BPGE. Differences: there is an additional field GJAHR = fiscal year
and the value fields have slightly different names: WLJHR = value in controlling area currency WLJHV = distributed value in controlling area currency The records of this table have the structure of Dictionary structure RIPASW.
You must fill this table with the user value fields! Complete the fields as follows: - USERVAL = 4 character identification code for the user value field
- GJAHR = fiscal year
- WERT = value
Example 1
Assume that we are primarily interested in the assigned values that have already been settled to assets. Therefore, we first define a value FXAV in the fixed values of domain IM_USERVAL. Then we create include ZXBIMU02 with the code below:
*--------------------------------------------------------------------* * INCLUDE ZXBIMU02 * *--------------------------------------------------------------------*
REFRESH E_RIPASW.
LOOP AT I_RAIMACT
WHERE ABRKZ EQ '01'. " Setteled to FXA ... CLEAR E_RIPASW. " ... to be shown ... E_RIPASW-USERVAL = 'FXAV'. " ... as USER-values. E_RIPASW-GJAHR = I_RAIMACT-VERSN. " Version. E_RIPASW-GJAHR = I_RAIMACT-GJAHR. " Fiscal year. E_RIPASW-WERT = 0 - I_RAIMACT-WKG. " Setteled value ...
COLLECT E_RIPASW. ENDLOOP. *--------------------------------------------------------------------* Example 2 You can use the user exit to "filter out" certain cost elements from the actual values in IM reporting. This could be useful, for example,
if there were no "real" settlement of measures to fixed assets or cost centers, and instead the actual values of the measures are reduced by normal debits. If this is the case, the cost elements that are used for the debits would have to be filtered out from the actual values in reporting.
If the cost element used for the debits was 699999, then the programming for filtering out this cost element in include ZXBIMU02 would look like this:
*--------------------------------------------------------------------* * INCLUDE ZXBIMU02 *
*--------------------------------------------------------------------* DELETE I_RAIMACT WHERE KSTAR EQ '0000699999'.
*--------------------------------------------------------------------* Note In this example, it is not actually necessary to define the user value
Function/Program: - EXIT_SAPDBIMA_002: Definition of User Value Fields
|