After upgrade error GR 410 appears during generation

[] [] [] [] [] [] [] []

  1. Error message M7162 during GR for PO with account assignmentSymptom You enter a goods receipt for the purchase order with Transaction MIGO. The purchase order is assigned to a product cost collector. Transaction MIGO displays error message M7162 “Order & cannot...

Symptom

After upgrading to ERP 2004 or higher release the generation of a Report Painter report aborts with the error message GR 410 “Characteristic & cannot be combined with key figures”.
This occurs for a report that was used before the upgrade and where no changes were made either to the report definition or to its reporting table.
The following case is known to date:
In the columns the key figure ’statistical quantities’ and in the rows the characteristic ‘company code’ are being used.

Other terms

REPORTWRITER, SGRW_UPGRADE, SGRW_MESSAGE, GR410
Reason and Prerequisites

In Release ERP 2004 the field ‘BUKRS’ was added to the tables COSP and COSS. This meant that the company code can now be determined directly, which concesquently also means and improvement in performance when determining the company code.
However for Report Writer reports this led to one small disadvantage:
Now the rule applies whereby a key figure used in a report may not refer to a database table that does not contain a characteristic used in the report.
In this case the key figure ’statistical quantities’ (table COSR) is being used in the columns, so the characteristic ‘company code’ (now in tables COSP and COSS) may not be used in the rows of the report.
In order to get around this situation and still be able to use a characteristic for company code in the report you have to define a virtual characteristic for the company code.

Solution

You want to create a virtual characteristic for the company code:
1. Maintain the corresponding field in structure CCR1S.a) After calling up transaction SE11, enter “CCR1S” as the object name and choose the function “Change”.b) Then double-click on the INCLUDE structure CI_CC1S and confirm the creation of the structure CI_CC1S.c) Now enter the new field (for example ‘ZBUKRS’ – identify it uniquely by giving it the short description “Virtual company code”) in the INCLUDE structure CI_CC1S of structure CCR1S.
By entering the newly inserted field into the INCLUDE structure CI_CC1S, you ensure that it is not overwritten during the next release upgrade.2. Maintain table T804C using transaction SM31
Since virtual characteristics should be calculated at runtime in an ABAP/4 exit, the corresponding ABAP/4 exit must be known to the Report Writer. This is done by making an entry in table T804C which can be maintained using transaction SM31:a) Enter ‘CCSS’ in the field “Table”.b) Enter the new virtual company code ‘ZBUKRS’ in the field “Field name”.c) Enter the ABAP/4 exit which is to be used for calculating the virtual characteristic in the field “Filler routine” of the maintenance screen.
In your case enter the ABAP/4 exit E19_FILL_CCR1S_BUKRS which is found in Include FK21RE1A of program SAPFK21R.d) Set the flag “Filling in selection”.e) Enter ‘OBJNR’ in field “Defining field”.f) Enter ‘KOKRS’ in field “Conv.parameter”.3. Activate the new characteristic in the relevant library
Call transaction GR22 and activate the virtual characteristic by checking the box in front of the characteristic and save this change.
Now this characteristic can be used in the report definition.4. If you do not want to use values or sets in the report directly you will have to create variables for table ‘CCSS’ and field ‘ZBUKRS’.
You can then use these variables in your report(s).
Do not forget to create a set for this new field if you intend to use a set variable in your report.5. Call the transaction GRR2 and open the affected report definition.6. Open the report element where you want to use this new characteristic.
If you are already using the other ‘BUKRS’ company code characteristic remove this and choose the new ‘ZBUKRS’ (virtual company code).
Be sure to have given your new company code field ‘ZBUKRS’ a different name than ‘BUKRS’.7. If texts should also be output in reports for this new virtual characteristic ZBUKRS, you must program a corresponding ABAP/4 exit for specifying these texts.
The ABAP/4 exits for customer-specific characteristics must be stored in program FK21REZT, so that they can also be used after a release upgrade.a) Add for example the following coding lines to Include FK21REZT:
* Include for fetching company code texts for new field
CASE FELD.
WHEN ‘ZBUKRS’.
bukrs = wert.
SELECT SINGLE * FROM t001 WHERE bukrs = bukrs.
IF sy-subrc EQ 0.
ktext = t001-butxt.
ltext = t001-butxt.
ENDIF.
ENDCASE.b) Activate the Include after entering the coding lines.
Please note that you do not need to carry out a syntax check as this is an Include and a syntax check will therefore end with a meaningless compilation error.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment