Ansicht
Dokumentation

AAIR0001 - IM-IS: User value fields in app.req. reporting

AAIR0001 - IM-IS: User value fields in app.req. reporting

CL_GUI_FRONTEND_SERVICES - Frontend Services   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

Background

Enhancement AAIR001 corresponds to the function of enhancement AAIP0002 for drilldown reports, that can be used for reporting on appropriation requests without needing an investment program.

You can start these reports, for example, using transaction IMD0. You can use the entry help (F4) for this transaction to see the names of the reports.

Standard reporting for appropriation requests primarily displays budget values, plan values and distributed values. You can also define your own drilldown reports in which you define various mathematical combinations of the three basic value fields stated above.

You may need reports on value fields that are not included in the functions listed above. In that case, you can create reports on these value fields using SAP enhancement AAIR0001.

Aktivating and Programming SAP Enhancement AAIR0001

Follow the procedure below:

  1. Define names (= fixed values) and short descriptions for the user value fields you want to include in the reports.
Maintain fixed values of domain IM_USERVAL in the ABAP Dictionary (transaction SE11). Specify a key that is a maximum of 4 characters long for each user field. Enter a short description for each.
  1. Include SAP enhancement AAIR0001 in an enhancement project (using any key).
Use the function Projekt management of SAP enhancements (transaction CMOD).
  1. Create the ABAP program ZXAIRU01 as an include program.
  2. Program the supplying of values to your user fields in program ZXAIRU01.
The code of this include is run through exactly once for each appropriation request, assigned variant and measure.
  1. Generate program SAPLXAIR.

After making these preparations, you can define your own drilldown reports that use the new user value field: Define forms, in which the "ID for user value field" characteristic has been specified for the appropriate rows.

Parameter

In program ZXAIR01, the following parameters are available:

  • Object type I_OBART.
The object type describes which object is currently being processed:
  • IQ = appropriation request

  • IO = assigned variant

  • OR = assigned order

  • PR = assigned WBS element

  • Field I_POSNR
The field contains the number of the appropriation request currently being processed.
  • Field I_VARNT
The field contains the number of the variant currently being processed (however, only when I_OBART = IO).
  • Structure I_AUFKV
The record has the structure of Dictionary table AUFKV.
It contains fields on the current order (however, only when I_OBART = OR).
  • Structure I_PRPS
The record has the structure of Dictionary table PRPS.
It contains the fields on the current WBS element (however, only when I_OBART = PR).
  • Table I_RAIMACT.
The records of the table have the structure of Dictionary structure RAIMACT.
The table contains the (summmarized) actual values (however, only when I_OBART = OR or I_OBART = PR).
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 fixed asset
02 - settled to 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):
  • OBJNR = CO object number (for measures or variants of approp. request)

  • WRTTP = value type

01 = Plan (measure)
41 = Budget (measure)
39 = Plan (appropriation request)
  • VORGA = transaction (original, supplement, return, ... )

  • WLGES = 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 meaning of the fields of table I_BPJA are the same as for table I_BPGE. The only differences:
the field GJAHR = fiscal year is added
the value field has a slightly different name: WLJHR = value in controlling area currency
  • Table I_BPCOSU
The records of the table have the structure of Dictionary table BPCOSU. The table contains the total of the added plan values from the cost element planning on the measures (however, only when I_OBART = OR or I_OBART = PR).
The meaning of the fields of table I_BPCOSU are the same as in table I_BPJA. The value type is not included, since it is always type 01 (plan on measures). Values for fiscal year 0000 are overall values.
The value field in table I_BPCOSU is called:
COSUM = value in controlling area currency.
  • Table E_RIPASW
The records of the table have the structure of Dictionary structure RIPASW.
This table must be filled with values from the user value fields!
Fill the fields with values as follows:
  • USERVAL = 4-character ID of user value field (defined fixed value)

  • GJAHR = fiscal year

  • WERT = value

Example 1

Assume that we are especially interested in that part of the distributed values, which was already settled to fixed assets.

We define a new value FXAV in the fixed values of domain IM_USERVAL. Then we create the include ZXAIRU01 with the following code:

*--------------------------------------------------------------------*
*   INCLUDE ZXAIRU01                                                 *
*--------------------------------------------------------------------*

IF I_OBART EQ 'OR' OR I_OBART EQ 'PR'. " Only for measures

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-GJAHR.    " Fiscal year.
  E_RIPASW-WERT  = 0 - I_RAIMACT-WKG.  " Setteled value ...
  COLLECT E_RIPASW.                    " ... = year value
  E_RIPASW-GJAHR = '0000'.             "
  COLLECT E_RIPASW.                    " ... as well as overall value.
ENDLOOP.

ENDIF.
*---------------------------------------------------------------------*

Please be aware that there is a possible pitfall, that is made clear in the above example: Plan values and budget values are stored either as annual values or overall values. In order to make a comparison of actual values with both annual values and overall values possible, you need to make some technical adjustments. In table E_RIPASW, an entry has to be generated with both the fiscal year for the entry, as well as an entry that is independent of the fiscal year (GJAHR = 0000)!

Example 2

You can also use this user exit in order to "reverse" certain cost elements from the actual values of 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 reversed from the actual values in reporting.

We define the new value STOR for the reversal values in the fixed values of domain IM_USERVAL

If the cost element used for the debits was 699999, then the programming for reversing this cost element in include ZXAIRU01 would look like this:

*--------------------------------------------------------------------*
*   INCLUDE ZXAIRU01                                                 *
*--------------------------------------------------------------------*

IF I_OBART EQ 'OR' OR I_OBART EQ 'PR'. "only for measures

LOOP AT I_RAIMACT
     WHERE KSTAR EQ '0000699999'.
  CLEAR E_RIPASW.
  E_RIPASW-USERVAL = 'STOR'.            "as USER-value
  E_RIPASW-WRTTP   = I_RAIMACT-WRTTP.   "...with the same WRTTP
  E_RIPASW-GJAHR   = I_RAIMACT-GJAHR.   "...and the same fiscal year
  E_RIPASW-WERT    = 0 - I_RAIMACT-WKG. "...but negativ value
  APPEND E_RIPASW.
ENDLOOP.

ENDIF.
*--------------------------------------------------------------------*

Unlike in the previous example, the field E_RIPASW-WRTTP receives a value here.

As a result, this change is effective in all pre-defined standard reports for the display of distributed values. Therefore, you do not have to define your own drilldowns that interpret the user field.






TXBHW - Original Tax Base Amount in Local Currency   General Material Data  
This documentation is copyright by SAP AG.

Length: 12475 Date: 20240420 Time: 015032     sap01-206 ( 166 ms )