Discover how to activate additional quantity fields in account-based Profitability Analysis (CO-PA) so that quantities are also included in reporting. These additional quantity fields are made available in the Controlling module (CO) line-item tables, CO-PA top-down distributions, and CO-PA assessment cycles.
Key Concept
In SAP S/4HANA Finance, up to three additional quantities can be defined per controlling area. Each additional quantity is assigned a dimension, such as length or mass. Optionally, a standard unit of measure can be assigned to each additional quantity in order to facilitate aggregation.
A new feature in SAP S/4HANA Finance allows you to activate additional quantity fields in account-based Profitability Analysis (CO-PA), which can then be used in reporting, CO-PA top-down distributions, and CO-PA assessment cycles. After activation, the additional quantity fields can be updated using the SAP-provided Business Add-In (BAdI) FCO_COEP_QUANTITY.
For example, an additional quantity field could be used in the wholesale and distribution industries, where it is common to store the quantity not just in a sales unit of measure, but also in a base unit of measure that is common across all product lines. This allows the quantities to be aggregated across product lines, producing common quantities that can then be used to drive cost allocations (e.g., top-down distribution in account-based CO-PA).
In this article, I present the configuration details for adding an additional quantity field without any dimension; the specifics of the Business Add-In (BAdI); and the implementation method. Through examples, I also explain how Profitability Analysis (CO-PA) reports are populated and I describe the implicit enhancement, which is needed to dynamically populate the quantity when the base unit of measure belongs to multiple dimensions.
Define Additional Quantity Fields
To activate additional quantity fields, follow IMG menu path Controlling > General Controlling > Additional Quantities > Define Additional Quantity Fields. Click the execute icon beside Define Additional Quantity Fields to display the screen in Figure 1.

Figure 1
Define additional quantity field details
For every controlling area, you can define up to three additional quantity fields. You’ll need to assign a dimension for each quantity field for a specified controlling area, i.e., an organizational unit in the SAP system that is similar to a company code. You can leave the field under Std. UoM (standard unit of measure) blank, or you can specify one when aggregation is desired in order to drive allocations or top-down distributions. For instance, you could specify KG for a quantity produced with a dimension such as MASS.
To enable consistent reporting of all posted quantities in a base unit of measure, irrespective of the dimension, I set up Additional Quantity Field 1, and I left the Std. UoM field blank. In Figure 1, you can see that I chose dimension AAAADL, which happens to be a dimensionless dimension, but SAP does provide it as an option for units such as PAC, EA, and PC. Please note that the Std. UOM is optional.
Implementing BAdI FCO_COEP_QUANTITY
To activate BAdI FCO_COEP_QUANTITY according to your requirements, work with your ABAP developer. Here is how the BAdI was implemented in our example:
BAdI: FCO_COEP_QUANTITY
Method: CALCULATE_QUANTITIES
Programming logic: If the unit of measure (IS_COEP-MEINH) is different from the base unit of measure (MARA-MEINS), convert the unit to the base unit of measure.
After the conversion has been performed, the converted data and unit of measure should be stored in:
CV_QUANT1- Converted quantity
CV_QUNIT1- Unit of measure. (MARA-MEINS – Base UOM)
If the unit of measure (IS_COEP-MEINH) and the base unit are the same, then data should be directly updated in:
CV_QUANT1-QUANT1- Value / quantity (IS_COEP- MEGBTR)
CV_QUNIT1-QUNIT1- Unit of measure (IS_COEP-MEINH)
The sample code used for achieving the above logic is shown in Figure 2.
************************************************************************* DATA: lv_buom TYPE mara-meins,
lv_mod_qty TYPE ekpo-menge,
lv_menge TYPE ekpo-menge,
lv_uom TYPE mara-meins,
lv_mat TYPE mara-matnr.
***Get base UOM for the material
IF is _coep-matnr IS NOT INITIAL.
SELECT SINGLE meins
FROM mara
INTO lv_buom
WHERE matnr = is_coep-matnr.
***if dcoument not posted
IF sy-subrc IS INITIAL.
IF is_coep-meinh IS NOT INITIAL.
MOVE is_coep-meinh TO lv_uom.
MOVE is_coep-megbtr TO lv_menge.
***if document is already posted
ELSEIF is_coep-meinb IS NOT INITIAL.
MOVE is_coep-meinb TO lv_uom.
MOVE is_coep-mbgbtr TO lv_menge.
ENDIF.
*** If sales unit is same as base UOM
IF lv_buom = lv_uom.
cv_quant1 = lv_menge.
cv_qunit1 = lv_uom.
ELSE.
***if unit of measeure is different from base UOM
IF lv_uom IS NOT INITIAL.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = is_coep-matnr
i_in_me = lv_uom
i_out_me = lv_buom
i_menge = lv_menge
IMPORTING
e_menge = lv_mod_qty
EXCEPTIONS
error_in_application = 1
error = 2
OTHERS = 3.
***populate converted qty and Sales UOM in respective fields
IF sy-subrc IS INITIAL.
cv_quant1 = lv_mod_qty.
cv_qunit1 = lv_buom.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ELSEIF is_coep-aufnr IS NOT INITIAL.
SELECT SINGLE matnr
FROM afpo
INTO lv_mat
WHERE aufnr = is_coep-aufnr.
IF sy-subrc IS INITIAL.
SELECT SINGLE meins
FROM mara
INTO lv_buom
WHERE matnr = lv_mat.
ENDIF.
IF lv_buom IS NOT INITIAL.
cv_qunit1 = lv_buom.
ENDIF.
ENDIF.
IF cv_qunit1 IS INITIAL.
cv_qunit1 = lv_buom.
ENDIF.
ENDMETHOD
*************************************************************************
Figure 2
Code for programming logic to activate BAdI FCO_COEP_QUANTITY
Implicit Enhancement to Overcome the Limitation of One Quantity Field to One Dimension
In our example, the company is using the codes LB (pound), EA (each), and FT (feet) as base units of measure for different materials, but it wanted to set up an additional quantity to facilitate reporting. During the implementation of the BAdI, I encountered a roadblock when I assigned a dimensionless unit to report quantity in base units of measure. This is because the base units of measure belong to various dimensions, which creates an incongruity that is detected by the standard SAP Check Function module, FCO_FDIM_CHECK (as shown in Figure 3). How so? For every unit of measure that is captured for a transaction, the module checks to see if the dimension of the unit of measure (i.e., reading from table T006) is the same as the dimension assigned for the configured additional quantity field. If they don’t match, then SAP issues an error to prevent you from proceeding further.

Figure 3
Standard SAP check for validating dimensions for units of measure
To overcome this limitation, I implemented the implicit enhancement as shown in Figure 4. It bypasses the standard Check Function module, FCO_FDIM_CHECK, by simply populating an X to ED_ALLOWED. This enhancement facilitates consistent reporting, even if the dimension of the unit of measure is different from the dimension of the configured additional quantity field.

Figure 4
Implicit enhancement to overcome the standard dimension check
Additional Quantity and Unit of Measure Fields in CO-PA Reports
As soon as the BAdI is implemented, the additional unit of measure is available in all Controlling (CO) tables. It is also available in the CO-PA Line Item Display—Actual Data transaction (i.e., transaction code KE24) and in reports after Execute Profitability Reports (i.e., transaction code KE30). In Figure 5, you can see that Additional Quantity Field 1 and Additional Unit of Measure 1 always represent the quantity in the base unit of measure. For instance, in Material 1000012977, the billed quantity is 3 EA (i.e., sales unit of measure). Using the conversion factor (i.e., 10 EA = 197 FT), 3 EA becomes 59.1 FT (i.e., base unit of measure), which is populated accordingly in the fields, Additional Quantity 1 and Additional Unit of Measure 1.

Figure 5
CO-PA Actual Line Items — A Sales and Distribution (SD) billing documents example
Figure 6 offers another example. Here, a material is scrapped in an alternate unit of measure, LB. The BAdI acccordingly populates the scrapped quantity in the base unit of measure within the fields, Additional Quantity 1 and Additional Unit of Measure 1.

Figure 6
CO-PA Actual Line Items — Material Scrap transaction
The principles presented in this article can be applied in many ways. I encourage you to use this information to try different variations of these configurations and to develop your own BAdI based on your requirements.
Note
As used in this document, "Deloitte" means Deloitte Consulting LLP, a subsidiary of Deloitte LLP. Please see www.deloitte.com/us/about for a detailed description of the legal structure of Deloitte LLP and its subsidiaries. Certain services may not be available to attest clients under the rules and regulations of public accounting.
This communication contains general information only, and none of Deloitte Touche Tohmatsu Limited, its member firms, or their related entities (collectively, the “Deloitte Network”) is, by means of this communication, rendering professional advice or services. Before making any decision or taking any action that may affect your finances or your business, you should consult a qualified professional adviser. No entity in the Deloitte Network shall be responsible for any loss whatsoever sustained by any person who relies on this communication.
Srikanth Vadlamudi
Srikanth Vadlamudi is an SAP-certified consultant in FI and Controlling (CO) modules with 11 years of experience implementing FI, CO, and Project Systems modules in chemical, automotive, manufacturing, consumer products and retail and distribution industries. He has global SAP implementation experience spanning North America, Europe, Asia, and Australia. As a team lead, he has successfully managed multiple projects in FI and CO, demonstrating experience in all phases of system implementation, including analysis, design, construction, testing, cutover, go-live, and production support. In addition, he has industry experience as a mechanical engineer, working for companies in plastic injection molding and sheet metal manufacturing.
You may contact the author at srivadlamudi@deloitte.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.