Expand +



How to Perform Product Profit Margin Calculations in SAP ECC

by David Burns, Owner of Prime, LLC

April 17, 2015

Take a tour of the product profit margin capabilities in SAP ERP Central Component (ECC) 6.0. Learn what your options are to measure, improve, and track your company’s profitability down to the lowest common denominator. Use this experience to formulate a long-lasting strategy that ensures a return on your investment (ROI) and guarantees your organization’s ongoing success.

There are several important considerations to weigh in creating your product profit margin strategy. The purpose of this article is to provide a comprehensive understanding of the data sources, integration, and configuration options and considerations.

You will learn some quick win strategies to make profit margins appear on your sales order header and line items using VOFM routines. Through the examples presented, you will learn how to configure profit margins and account for returns and refunds. You will learn about the essential components of profitability analysis (CO-PA) and product cost controlling (CO-PC) and the roles they play. In addition, you will gain a greater understanding of the interplay of CO-PA, CO-PC, FI, and sales and distribution (SD) and the contribution each makes to profit margin calculations.

Last, I will discuss other innovations in SAP profitability analysis, such as the CO-PA Accelerator software. You will gain insights into SAP’s roadmap for profitability analysis and the role played by SAP HANA, analytics software, and more.

Let’s begin with a discussion of business objectives. The profitability of a company is measured at three primary levels: gross profit, operating profit, and net profit. These numbers are provided on a company’s profit-and-loss (P&L) statement. The first measure, gross profit, is fundamental to setting prices and sales targets. Gross profit is sales net revenue minus cost of goods sold (COGS). In essence, it is total net sales minus the cost of producing goods or services. COGS is composed of labor expense, raw materials, and manufacturing overhead. Gross profit provides insight into the cost of labor, cost of raw materials, and manufacturing efficiency. As a ratio, gross profit margin is gross profit divided by revenue multiplied by 100.

The second profitability measure, operating profit, is calculated by subtracting selling, general, and administrative (SG&A) expenses from gross profit. It is a pretax calculation and generally understood to be a key measure of management effectiveness. Financial analysts consider operating profit a key measure of management effectiveness because managers have greater control over SG&A than, say, the cost of raw materials or labor. As a ratio, operating profit margin is operating profit divided by revenue multiplied by 100.

Net profit, the last of the profitability measures, subtracts interest, extraordinary items, and tax from operating income. As a ratio, net profit margin is net profit divided by revenue multiplied by 100.

Underlying overall business profitability, as reflected on the P&L, are individual product profit margins. They are the lifeblood of a company. Product profit margins are used in break-even calculations, production planning, product strategy, price setting, and forecasting. Individual product profit margins are vital to the company vision and strategic plan. Before I walk you through the various profit margin calculation options available in ECC, I define some key terms in the “Terminology” sidebar.


Some of the key terms used in profit margin analysis include price, gross profit, cost of goods sold (COGS), margin, and markup. Let’s put these terms into context with an example for a fictional entity, SkateRight Company. SkateRight manufactures skateboards at a cost of $10 each (i.e., COGS) and sells them for $50 (i.e., the sale price). SkateRight cannot reduce production cost from $10, unless there is a reduction in the cost of materials or labor. However, the sale price is set by the business, based on the projected number of units sold, demand, and revenue targets. In this example, SkateRight has gross profit per skateboard of $40 (i.e., $50 - $10, or selling price minus COGS). The gross margin in percentage terms is 80 percent (i.e., $40/$50, or profit divided by sale price). The markup on the bicycle is 40 percent (i.e., $40/$10, or profit divided by COGS).

What Options Are Available in SAP ECC 6.0?

There are several important considerations to weigh in creating your product profit margin strategy. The first is to know the capabilities and limitations in ECC 6.0. ECC has the tools to provide profit margin for a sales order, sales order line item, and by multiple dimensions (i.e., characteristics) in CO-PA.

Product Profit Margins on a Sales Order

The first item I show you is profit margin on the sales order header. If your sales department is disciplined and adheres to profit margin targets for the company, this is a useful strategy to employ. It does, however, have its limitations. Because you are seeing profit for the sales order as a whole, you aren’t analyzing individual product contributions. Aristotle is famously quoted as saying “The whole is greater than the sum of its parts.” With regard to a sales order, however, it is absolutely the sum of its parts. Well, Aristotle was, after all a philosopher, and not a businessman.

The profit margin for a sales order header can be displayed as a percentage or in units of currency (e.g., dollars). From here on, I refer to currency as dollars. Let’s see an example by displaying a sales order. From the application menu path, select Logistics > Sales and Distribution > Sales > Order > Display or use transaction code VA03. In the Display Sales Order initial screen, enter your sales order number and press Enter (Figure 1).

Figure 1
Enter a sales order number in the Display Sales Order screen

This action opens the Display Standard Order Overview screen (Figure 2). In this screen, click the Display doc. Header details icon.

Figure 2
The Display Standard Order Overview screen

In the next screen, click the Conditions tab to view the profit margin for the entire sales order (Figure 3). If you want to restrict who can see certain condition types (i.e., price, discounts, etc.) and subtotal lines (e.g., profit margin), you can put in authorization restrictions. See SAP Note 105621 – Authorization check for the condition screen.

Figure 3
Sales order header conditions

Double-click the Profit Margin line to see condition details, as shown in Figure 4.

Figure 4
Sales order header condition details

Click inside the Alt.calc.type field to get the drop-down selection icon  to appear. Then click the Alt.calctype drop-down icon to see available VOFM formula value routines, as shown in Figure 5. VOFM is an enhancement toolbox that allows you to create or assign routines and calculations to business processes. In this example, the sales order condition type uses routine 11 to compute the profit margin, in dollars, by subtracting cost from the net value.

Figure 5
VOFM formula value routines

From the drop-down list, select routine 11 and press F5, as shown in Figure 5. The code, which is shown in Figure 6, calculates the condition value (i.e., profit margin in dollars), stored in KOMV-XKWERT, as the net value of the sales order (i.e., KOMP-NETWR) minus cost (i.e., KOMP-WAVWR).

Figure 6
ABAP code VOFM formula value 11

Remember that finance and accounting are dependent on net value and cost being correct. To achieve this, many other factors come into play that I address later.

This SAP condition value formula can appear on your sales orders by assigning it to a value line at the end of your pricing procedure.

The profit margin for a specific sales order line item can also be displayed, and therefore, the profit margin for a specific material (i.e., product or finished good) can be displayed. From the SAP application menu, select Logistics > Sales and Distribution > Sales > Order > Display or execute transaction code VA03. In the Display Sales Order initial screen, enter your sales order number in the Order field and press Enter (Figure 7).

Figure 7
Display sales order

In the display sales order overview screen, double-click a line item (Figure 8).

Figure 8
Select sales order line item

In the next screen, click the Conditions tab to view the profit margin in dollars for the line item (Figure 9).

Figure 9
Display sales order line-item data conditions

At the line-item level, you can display condition type data, as shown previously with the sales order header data. Double-click the profit margin line to see condition details (Figure 10).

Figure 10
Sales order condition details

Figure 10 shows that the profit margin subtotal is assigned to VOFM condition value 11.

To include profit margin as a percentage instead of dollars, you use VOFM routine 18 as the basis for a customer-created routine, which you then assign to the pricing procedure. To see the standard ABAP code for routine 18, follow IMG menu Sales and Distribution > System Modifications > Routines > Define FORM Routines for Data Transfers or use transaction code VOFM. From the Requirements & Formulas screen, select from the pull-down menu Formulas > Condition value (Figure 11).

Figure 11
VOFM formula menu

In the next screen, double-click routine number 18 (Figure 12).

Figure 12
Display VOFM formula condition values

The standard ABAP code for routine 18 is shown below in Figure 13.

Figure 13
ABAP code VOFM formula value routine 18

As you can see in Figure 13, there is a lot more ABAP code for routine 18 than there is for routine 11. Much of this has to do with potential number conversion and arithmetic errors. The ratio calculation itself is in line 17, and it contains an error in logic. Line 17 multiplies the profit in dollars (i.e., xkwert) by 100000 and then divides by net value (i.e., komp-netwr). Using the SkateRight example from the “Terminology” sidebar, this formula would calculate the profit margin of one skateboard as follows:

$40 (profit) x 100000/$50 (net value or price) = 80000%

The correct calculation is $40 x 100/$50=80%

To fix the issue, copy routine 18 to create your own customer routine and change the multiplier from 100000  to 100. You now have a custom routine (i.e., customer routine) that you can assign to your pricing condition as a subtotal line.

Populate Subtotals in VBAP and VBRP

To make more permanent use of the product profit margin subtotals for use in reports and queries, you can configure your pricing procedure to populate standard subtotal fields KZWI1-6 in tables VBAP and VBRP. You need to be careful during this process, because there are standard formula values set to populate these fields. So carefully analyze which fields are being populated today and from what routines. Moreover, make sure to carefully document the use of these fields so that a good trail exists in considering future redesign efforts and enhancements.

To populate any of the KZWI1-6 fields, access pricing procedures from IMG menu Sales and Distribution > Basic Functions > Pricing > Pricing Control > Define And Assign Pricing Procedures, or execute transaction code V/08. Select your pricing procedure in the Procedures pane and double-click the Control folder in the dialog structure area in the upper left corner of the screen (Figure 14).

Figure 14
Pricing procedure configuration

This action opens the Control Overview screen (Figure 15). In the Reference Step Overview pane, there is a field under the Su Tot (subtotal) column with the number 6 assigned to it. This indicates that for pricing procedure RVAJUS, the subtotal field KZWI6 will be populated with the profit margin data. The field below the CalTy… (calculation type) column, to the far right side of the screen, contains value 18. This value indicates that the subtotal line will be populated via the VOFM formula value 18.

Figure 15
Pricing procedure Control Overview screen

Although this approach pales in comparison with the myriad of product profit margin capabilities in CO-PA, it offers a solution that has many possibilities. First, it hands out real-time financial data, based on sales and billing. Second, you can design custom queries and reports that combine multiple dimensions, such as material, plant, sales group, or division. Last, the time and implementation cost required to implement makes for a quick win. One of the downsides is that you need to develop custom queries and reports with logic to subtotal, summarize, or calculate margins on a multi-dimensional basis, if you choose to do so. Another downside is that you don’t have nearly the multi-dimension reporting capability that you have in standard CO-PA. Basically, you are limited to the data elements in those tables (i.e., VBAP and VBRP).

CO-PA and Product Costing (CO-PC)

The biggest challenge in product profit margin analysis is intellectual capital and SAP savvy. So much data needs to be brought together, and an understanding of the SAP integration appears daunting to most. In addition, it requires specialized expertise in areas like CO-PA, production planning (PP), sales and distribution (SD), and CO-PC. For these reasons, many companies fail to take full advantage of CO-PA functionality in ECC.

However, CO-PA is the undisputed best practice for profitability analysis in an SAP system. It also serves as the OLTP database on which other databases and software depend (e.g., SAP HANA, SAP Business Warehouse, and SAP Profitability and Cost Management).

CO-PC and CO-PA deserve, in their own right, an entire article devoted to product margin analysis. In this article, I just discuss some of the more important functionalities of each.

CO-PC is key to COGS calculations. Without accurate COGS, product profit margin analysis is futile. CO-PC enables the valuation of materials and their internal cost. The process begins with planning. Cost center plans are made by activity type and cost element and quantities are planned by activity type. These plans become important when calculating quantity and dollar variances.

In CO-PC, activity type rates are calculated. These rates capture the planned cost for each activity in the production cycle. In essence, activity rates are your costs of production (i.e., internal activities). When you calculate activity rates, it is critical that you grasp the concept of CO distributions and assessments. The calculation of activity rates is either based on pre- or post-distributions or assessments. This is a business decision that is important to the planning process.

Likely the most complex concept in CO-PC, quantity structure (QS) is the concept that provides integration with PP and FI. PP becomes relevant because of the bill of materials (BOM) and routings. These, in turn, enable the calculation of COGS, which update FI and are available for margin calculations. The QS concept has a lot of moving pieces. In addition to BOMs and routines, it includes work centers (i.e., where a production process or step is performed), material masters, and the material cost calculation (i.e., standard or moving average price).

The next crucial step in CO-PC is the costing run. This is where material costs are calculated, en masse, for a specific date range and company code. It is dependent on the configuration of costing and valuation variants. To get the best results from your costing run, you need financially minded individuals and accountants working closely with logistics people, who typically own material masters. The implications are widespread and include cost selection, material price updates (i.e., standard, moving average, purchase information record, and planned prices).

Through variance analysis, actual costs are compared against standard costs, and work in process (WIP) and settlements are calculated. Costs are captured and settled through production orders and product cost collectors.

CO-PA is most useful when configured to provide product margin detail, in conjunction with other elements (i.e. characteristics). Most commonly, product margins are also reported by region, customer, and sales organization. Together they are referred to as segments.

In CO-PA, you define characteristics (e.g. product, customer, regions) and value fields (e.g. material cost, labor cost, and revenue). Integration with materials management (MM) becomes important for valuations and material cost estimates. These are managed through the configuration of valuation strategies and costing keys.

Once designed and configured, CO-PA has a great deal of flexibility in creating reports. You define variables that are used for forms and reports. In essence, they are the selection parameters for a report or the key fields you populate to send back a selection of data. You also define forms for profitability reports. Defining these forms sets the content and structure of a report. You can perform calculations, create totals and subtotals, and even select color types.

Returns and Refunds

The specifics of the order return process is beyond the scope of this article, but I address the impact that returns and refunds have on both CO-PA and profit margins. Of course, the business objective is to keep product returns and refunds to a minimum. Yet, customer returns are a part of doing business and must be accounted for in profit margin analysis.

There are several different types of returns. Among them are damaged goods, defective goods, errors in order quantity, and customer dissatisfaction. To process a return within an SAP system, the most basic of scenarios is to create a return order via transaction code VA01, using order type RE. This can be done with or without reference to the original sales order or billing document. If the goods are returned to a warehouse, the next step is to create a return delivery using transaction code VL01N and then to post a goods return. The goods issue for the return delivery then is matched with a goods receipt. Last, you need to create a credit memo to the customer, unless a replacement order is to be issued.

Traditionally, there have been a few different approaches in sending return values to CO-PA. One approach, although not a very good one, is to map returns to the same line as sales revenue. The problem with this is twofold. First, CO-PA by default populates all numbers as positive (i.e. no +/- sign). Second, you need to call out your returns separately for analysis.

A better approach for returns, refunds, discounts, and other miscellaneous financial activity is to create a separate value field and map the appropriate condition types to it. Figure 16 is an example in which a value field (e.g., VV010) is mapped to an SD condition type (e.g., ZCTR) for refunds. This configuration is accessed using transaction code KE4I or following IMG menu path Controlling > Profitability Analysis > Flow of Actual Values > Transfer of Incoming Sales Orders > Assign Value Fields.

Figure 16
Assign value fields to SD conditions

Once you have your returns, refunds, and other values mapped separately in CO-PA value fields, you need to make sure your CO-PA reports are set up to calculate net profit, using formulas. You can define CO-PA report forms by following IMG menu path Controlling > Profitability Analysis > Information System > Report Components > Define Forms for Profitability Reports.

Figure 17 shows is an example report with the formula line for total gross sales.

Figure 17
CO-PA form formula line total gross sales

In Figure 18 is the same report with the formula line for total gross sales.

Figure 18
CO-PA form formula line total net sales

Notice in Figure 19 that the formula line adds total gross sales (Y008) and sales deductions (Y015) to calculate total net sales. If all the values flowing into CO-PA were positive, this formula would be incorrect. However, in Figure 18 the value fields have the Transfer +/- indicator checked.  As such, the values for refunds and returns flow into CO-PA as negative numbers (Figure 19).

Figure 19
CO-PA report with negative values

Warehousing and Analytics

I’d be remiss in this article not to briefly mention the SAP roadmap for CO-PA. Several challenges have developed over the decades in relation to ERP, big data, and system performance. In addition, one of the biggest criticisms of SAP ERP has been the user interface. So, you take the issue of big data, the need for enhanced system performance, and the demand for a better user experience, and you get a roadmap for CO-PA that adds SAP HANA and BusinessObjects to the mix. No surprise there, right?

SAP developed the CO-PA Accelerator software, which replicates the traditional CO-PA database to a secondary SAP HANA database. Using a generated model in SAP HANA, you can then create dashboards, reports, and do further modeling and analysis in BI. It does require SAP HANA and BI instances to install and design, but from an ECC perspective, you set up your connection to SAP HANA and ECC and then schedule replication.

The CO-PA Accelerator can also be used in conjunction with SAP Business Warehouse (SAP BW) or Customer and Product Profitability (PCM). To set up a replication model to connect CO-PA to SAP BW, you need to create a DataSource in ECC and the rest is handled by an SAP BW InfoCube.

As a stand-alone application, CO-PA provides product profit margin calculations in real time. It enables you to do these calculations with multiple dimensions (e.g., product, customer, and region). ECC also has the capability of displaying profit margins as subtotal lines in the sales order header and line item data. This method also allows you to populate subtotal fields in tables VBAP and VBRP, thereby enhancing your reporting and query capabilities.

Although product profit margin is a financial calculation, there is an abundance of sales and logistics activity on which it relies. It relies on SD for sales orders, billing, and pricing. It relies on materials management (MM) and production for the cost of materials, cost of production, and valuation of finished goods. It uses CO costing sheets, valuation methods, activity types, and more to ensure your financial data accurately reflects the cost of doing business.

You could argue that profitability analysis is the most important aspect of running a business. With that said, it’s hard to say how much you should invest in time, money, and energy. It often comes down to how much you have to invest and the time you have in which to do it. SAP offers several good solutions. Replicating CO-PA to SAP BW is quite a common approach. The SAP CO-PA Accelerator software certainly offers the best in performance; with BI as the front-end, you also get a better user experience.

No matter how big your pocketbook is or whether or not you use an OLAP database like SAP HANA, the key to your success in profitability analysis is a solid CO-PA design. As the saying goes, garbage in, garbage out.

An email has been sent to:


David Burns

David Burns ( is CEO and founder of Prime, LLC. David has specialized in SAP Financials since 1998. Since founding Prime, LLC in 2008, he focuses on techno-functional consulting on a cross-modular basis, with a special emphasis on SAP configuration optimization and FI integration.

More from SAPinsider


Please log in to post a comment.