You are on page 1of 2

2023-06-20 2545080

2545080 - Include additional fields in PCA actual line


item report
Version 2 Type SAP Note
Language English Master Language German
Priority Correction with low priority Category Consulting
Release Status Released for Customer Released On 30.07.2020
Component EC-PCA-IS ( Information System )

Please find the original document at https://launchpad.support.sap.com/#/notes/ 2545080

Symptom

You want to include more fields in the actual line item report of the classic Profit Center Accounting (report
RCOPCA02).

Other Terms

KE5Z RCOPCA02 RPCA2 KE5ZH

Reason and Prerequisites

The fields must exist in the actual line items table GLPCA.

Solution

To include a field in the actual line item report, proceed as follows:

1. Call ABAP Dictionary (transaction SE11) and display the table GLPCA. Here, in one row, you can find the
field names and the data element for the field that you want to include.

2. Enhance the reporting structure RPCA2 by adding this field. You can do this either by making a direct
change to the structure (transaction SE11 -> structure RPCA2 -> choose "Change -> Edit/Change-> Insert
Field": Enter the field name and data element. Do not add the new field at the beginning of the structure.
Instead, add it to second half of the structure. -> Save and activate the structure). Alternatively, you can add
an append to the structure.

3. Now go to ABAP Editor (transaction SE38). Enter the program RCOPCA02. The new field must be made
known in the subroutine fieldcat_fill. Add the sample source code lines specified below and adjust them to the
field you require. Note that the position where you insert the rows influences the position of the column in the
report.

Sample source code: Replace SGTXT with the field name of the required field in the process. Supplement
the description of the field in the comment line.

* <Description of new field> " note 2545080


add 1 to i. " note 2545080
clear afield. " note 2545080
afield-col_pos = i. " note 2545080
afield-fieldname = 'SGTXT'. " note 2545080
afield-no_sum = 'X'. " note 2545080

© 2023 SAP SE or an SAP affiliate company. All rights reserved 1 of 2


2023-06-20 2545080

afield-ref_tabname = 'GLPCA'. " note 2545080


afield-no_out = 'X'. " note 2545080
append afield to t_fieldcat. " note 2545080

This is a modification.

You can also make the field known in the subroutine fieldcat_fill without a modification by programming an
implicit enhancement option. To do this, go to "Show Implicit Enhancement Options" in the program
RCOPCA02 by choosing "Edit -> Enhancement Options". The implicit enhancement option is displayed at the
end of the subroutine fieldcat_fill.

Information about the line item browser in Profit Center Accounting (transaction KE5ZH)
The line item browsers were created based on an SAP HANA database. The line item browser KE5ZH of
Profit Center Accounting (PCA) reads the data in the table GLPCA. However, you can access additional
fields. This enables you, for example, to output the "Name1" and "Name2" fields of the tables KNA1 and
LFA1.
For important basic information about the line item browsers, see SAP Note 1789045.

Terms of use | Copyright | Trademark | Legal Disclosure | Privacy

© 2023 SAP SE or an SAP affiliate company. All rights reserved 2 of 2

You might also like