Learn how to optimize the tracking of purchase price variance (PPV) in your procure-to-pay business process for better control over its monitoring. Discover the limitations of the SAP ERP Financials system and the different dimensions (e.g., cost component, vendor type, and source of supply) by which you can analyze a PPV.
Key Concept
The purchase price variance (PPV) in an SAP system is a composite variance between the total standard cost and total actual cost incurred to purchase the material. In the standard SAP system, this composite variance related to a document flow can be diverted to a particular general ledger account based on valuation class of the material, any substitution rules, or another criterion. A business can split this composite amount into various sources of supply (e.g., cost component contributing to standard cost) or vendor type (e.g., material vendor or service vendor). Splitting the PPV into various categories can make your PPV recording and reporting flexible. For example, a business can differentiate the freight part variance from its material cost variance. This process helps the business decide to what extent freight contributes to cost by booking variances for freight at the material level. The business can then plan its freight cost and decide which type of service provider (e.g., third-party carrier or internal carrier) is better in terms of freight cost.
- The prices you have planned (also called standard costs)
- The price included in the purchase order when you place your order with the vendor
- The price included in the invoice by the vendor
An SAP ERP system has a three-way matching functionality in a procure-to-pay process, whereby a goods receipt (GR) is checked with a purchase order (PO) and an invoice receipt (IR) is checked with a goods receipt (GR). If there is any difference, it is a purchase price variance (PPV). This PPV can occur during GR if the PO price differs from the standard cost IR if the actual invoice price differs from the PO price.
Businesses may plan the standard costs for the material, taking into account various components such as material cost, procurement cost, or landing cost. In a normal business flow of PO, GR, and IR, businesses use the standard SAP system as follows:
- When ordering goods, businesses place a PO for such material. This PO covers the entire purchase price of the material for various components (e.g., material cost, transportation cost, or insurance). You find these components in the price conditions for the PO.
- When receiving goods, businesses book the inventory cost at standard cost, and the GR/IR clearing account is booked at the PO price for material and contracted price for delivery cost. Now the standard SAP system calculates the PPV as a single composite figure, regardless of the various cost components a material has, and posts this entire amount to a PPV account. Thus, you can’t differentiate between the material cost and the landing cost when the goods enter stock.
- When receiving invoices, businesses may receive one invoice from the vendor that supplies the goods (i.e., the material vendor) and another invoice from a third-party carrier or internal carrier taking care of transportation (i.e., the carrier) and post separate invoices for each vendor. Both of these invoices are posted with transaction MIRO.
The standard SAP system calculates the PPV for a material vendor (comparing the ordered price for material and the invoice amount) and the PPV for a carrier (comparing planned delivery cost and invoice amount) separately. The limitation of this SAP process is that both PPVs are posted to the same PPV general ledger account using the standard account key PRD. Consequently, businesses cannot analyze how much variance relates to material and how much variance relates to other components (e.g., landing cost). Thus, businesses face difficulty in controlling the variance at the source. If variances are high, then businesses can use this as a basis for negotiation with a carrier.
Another situation you find is that the same material is purchased from intergroup companies and also from third parties. Again, I recommend that you track the variance separately for the two procurement alternatives. You can achieve this segregation to decide whether to purchase from an intergroup company or a third party. This process of segregating the variances leads to better recording and reporting of variances, and businesses can take corrective and preventive actions to stop such variances from occurring.
I explain the limitations of the SAP system and suggest workarounds to these limitations in the following sections of this article:
- Configuration data and master data settings
- Standard flow of PO, GR, and IR
- Custom configuration for splitting and custom program logic
- Splitting of PPV
- Reporting of split PPV
Configuration Data and Master Data Settings
For standard costing of material, you define a cost component structure and link it to the company code, plant, and costing variant. You define and assign this cost component structure setting by using transaction OKTZ or following customization path SPRO > Controlling > Product Cost Controlling > Product Cost Planning > Basic Settings for Material Costing > Define Cost Component Structure (Figure 1). In this example, I consider the cost component of raw material and purchases as material costs. I consider freight, duty, and other components as delivery costs.

Figure 1
Cost component structure customization
I use a raw material purchase to simplify the example, and thus it does not have cost components such as labor, machine running cost, and so on. In a standard SAP system you also can define two cost component structures at a time for valuation (i.e., for a particular combination of company code, plant, and costing variant): One is primary cost component structure, and the second is auxiliary cost component structure. A cost component structure breaks down the results of a cost estimate into various cost components (e.g., material cost or delivery cost). You can configure different cost component structures to have different breakups of cost estimates. Here I use an example based on auxiliary cost component structure; however, a business can also use a primary cost component structure.
Use transaction MM03 or follow menu path SAP Easy Access Menu > Logistics > Materials Management > Material Master > Material > Display > MM03 - Display Current, enter Material Number on the selection screen, and press Enter. Select view Accounting 1, enter the plant, and press Enter. To calculate the standard cost, the material master should have the Price control indicator as S (standard cost) (Figure 2).

Figure 2
The material master Accounting 1 view
Note
Origin groups are not relevant in this assignment as a material can have only one origin group, and I discuss splitting for the various cost components of the same material.
To check the various cost components of this material, use transaction code MM03 or follow the path SAP Easy Access Menu > Logistics > Materials Management > Material Master > Material > Display > MM03 - Display Current. Enter Material Number on the selection screen, and press Enter. Select view Cost Estimate 2, enter the plant, and press Enter. Click the Current button to show the current cost estimate for the material. Follow the menu Cost > Display Cost Components (Figure 3). (Because this is a raw material example for simplicity, it contains very few cost components. For finished goods, cost components might have more components such as labor and machine cost.)

Figure 3
The cost component view of standard cost for a material
Notice that the raw material cost is CHF 1,000.00, and delivery cost (freight cost) is CHF 100.00 for 100 KG. This value for raw material cost and delivery cost can be planned manually or can be automatically calculated based on purchasing conditions and other conditions, and then during standard costing, the system calculates the overall cost for the material for all cost components. In this example, you add the delivery to the standard cost via additive costing. During additive costing you can also enter a cost element for the delivery cost, and that cost element is linked to the cost component via the cost component structure definition (Figure 1). You can see additive costing using transaction CK76N or by following menu path SAP Easy Access Menu > Logistics > Production - Process > Product Cost Planning > Material Costing > Cost Estimate with Quantity Structure > Additive Costs > CK76N – Display.
Also use transaction OBYC to check the PPV GL account for this material valuation class or follow customization path SPRO > Material Management > Valuation and Account Assignment > Account Determination > Account Determination without Wizard > Configure Automatic Posting > Account Assignment. Notice that for a valuation class, you can provide only one GL account at a time (Figure 4). I address this SAP limitation of a single GL account for a variance related to various cost components for a material using a flexible custom development.

Figure 4
Standard SAP account determination for PPV
Standard Flow of PO, GR, and IR
I use an example of creating a PO for the aforementioned material and then posting a GR and IR for it. Create a PO for this material with an order price of CHF 2,000.00 for 100 KG from the raw material vendor (versus the CHF 1,000.00 per 100 KG as the raw material cost component in the standard costs for raw material). Use transaction ME21N to create this PO, or follow menu path SAP Easy Access Menu > Logistics > Materials Management > Purchasing > Purchase Order > Create > ME21N - Vendor/Supplying Plant Known (Figure 5).
Note
The material master details, values, and quantity are examples in this article to illustrate the logic.

Figure 5
An example of a PO, including the price conditions
Now the delivery (freight) cost contracted with the carrier is CHF 300.00 per 100 KG (versus CHF 100.00 per 100 KG as the freight cost component in standard costs for raw material). This component is included in the purchase price as the planned delivery cost condition type in Purchase Price Procedure, and the contracted rates are maintained as a condition record. Use transaction code TK13 or follow menu path SAP Easy Access Menu > Logistics > Logistics Execution > Master Data > Transportation > Shipment Costs > Prices > TK13 – Display > Display the condition type for Delivery Cost (Figure 6). You can also see the condition records value by selecting the condition type row in Figure 5 and clicking the Condition rec. button.

Figure 6
An example of a contracted delivery cost for freight
Now create the GR. Use transaction MIGO or follow menu path SAP Easy Access Menu > Logistics > Materials Management > Inventory Management > Goods Movement > MIGO - Goods Movement (MIGO). Select the Display Material Document option. Navigate to the Doc Info tab and click the FI Documents button. Select Accounting document. Now when you have posted the GR, the standard SAP system makes the posting (Figure 7).

Figure 7
An example of a GR accounting document
Note
In Figure 7, note that transaction keys are listed under the Trs column. You can use these keys to determine the GL account. I use these transaction keys in my solution approach later in this article.
Posting amounts are as follows:
- Inventory is debited with the total standard cost of CHF 1,100.00 (including both CHF 1,000.00 raw material cost and CHF 100.00 freight cost) using transaction key BSX and account 162120
- GR/IR material is credited for CHF 2,000.00 for the PO price using transaction key WRX and account 351200
- GR/IR delivery is credited for freight contracted amount CHF 300.00 using transaction key ZFR and account 351630
- PPV as a balancing figure (CHF 1,200.00) for this posting for accounting the total difference using transaction key PRD and account 505612
However, a business may want to see the PPV of CHF 1,200.00 split as follows:
- CHF 1,000.00 (CHF 2,000.00 [the PO price for raw material as in Figure 5] minus CHF 1,000.00 [the raw material cost component in standard cost of raw material as in Figure 3]) belongs to material cost
- CHF 200.00 (CHF 300.00 [the planned delivery cost as in Figure 6] minus CHF 100.00 [the freight cost component in the standard cost of raw material as in Figure 3]) belongs to delivery cost.
I now show you how to use custom development to split the PPV into these components. After GR, you receive a separate invoice from the material vendor that sends the invoice for the goods supplier and a separate invoice from the carrier that sends the invoice for the transportation charges to carry the goods. Now I discuss both the invoices.
The IR for the Material Vendor
Create the IR for goods. Use transaction code MIR4 or follow menu path SAP Easy Access Menu > Logistics > Materials Management > Logistics Invoice Verification > Further Processing > MIR4 - Display Invoice Document (Figure 8). Enter the invoice number and year and press Enter. Click the Follow-on documents button and select Accounting document. Now when you post this IR, the standard SAP system makes the posting.

Figure 8
An example of a material vendor IR accounting document
This invoice is for the price for goods. Note that the PPV is correctly calculated and posted separately (CHF 2,200.00 vendor invoice amount less CHF 2,000.00 PO price for material).
IR for Delivery Cost
As a next step to GR, create the IR for transportation cost. Use transaction code MIR4 or follow menu path SAP Easy Access Menu > Logistics > Materials Management > Logistics Invoice Verification > Further Processing > MIR4 - Display Invoice Document (Figure 9). Enter the invoice number and year, and press Enter. Click the Follow-on documents button and select Accounting document. Now when you post this IR, the standard SAP system makes the posting.

Figure 9
An example of a carrier IR accounting document
This invoice is for the cost of transportation. The PPV is correctly calculated and posted separately (CHF 400.00 vendor invoice amount less CHF 300.00 contracted value for freight). However, for both the invoices, the amount goes to the same GL 505612 (the PPV for RM Aroma Ch) as configured in OBYC for material valuation class as shown in Figure 4.
SAP reports are not able to show who caused the price variance (i.e., whether it is due to a high price from the material vendor or a high price from the carrier). The custom development that I explain aims to report the PPV into such components to different GL accounts.
Custom Configuration for Splitting and Custom Program Logic
You need to create five custom tables to define the splitting parameters. You can see these custom tables using transaction SE16 or SM30, provided that you have access to browse table contents in the SAP system.
Custom Table for Splitting Categories
Here you can define the master list of categories in which you want to split the PPV. Use transaction SE16 or SM30 or follow menu path SAP Easy Access Menu > Tools > ABAP Workbench > Overview > SE16 - Data Browser > Enter First Custom Table Name. The example in Figure 10 lists two categories, but you can further extend it for other categories if needed. This is just a master list as possible categories, and it links to cost components in the next table.

Figure 10
Custom table for splitting categories
Custom Table for Classification of Standard Cost Component Structure
Here you can define what component in the cost component structure (refer back to Figure 3) belongs to which split category (Figure 11). Use transaction SE16 or SM30 or follow menu path SAP Easy Access Menu > Tools > ABAP Workbench > Overview > SE16 - Data Browser > Enter Second Custom Table Name. This table just groups the various cost components into splitting categories. You should be able to select only those categories as defined in Figure 10.

Figure 11
Custom table for standard cost component structure
Custom Table for Classification of Actual Cost for GR
Define which account key used in the GR posting belongs to which split category (Figure 12). Use transaction SE16 or SM30 or follow menu path SAP Easy Access Menu > Tools > ABAP Workbench > Overview > SE16 - Data Browser > Enter Third Custom Table Name. For each GR posting, the SAP system uses the pricing procedure, and for each condition type in the pricing procedure, an account key is assigned to which the various debit credit in the GR posting happens. All the account keys mapped in the pricing procedure should also be mapped to splitting categories defined in the screen in Figure 10. Apart from that, default account keys used by the SAP system (e.g., WRX for GR/IR clearing, KDM for exchange rate differences) should also be linked to help group the amount posted in the GR using the account keys of each line into various split categories.

Figure 12
Custom table for the actual cost for GR
Custom Table for Classification of Actual Cost for IR
Here you define which vendor account group (related to vendor in invoice posting) belongs to which split category (Figure 13). Use transaction SE16 or SM30 or follow menu path SAP Easy Access Menu > Tools > ABAP Workbench > Overview > SE16 - Data Browser > Enter Fourth Custom Table Name. I assume that a business uses a separate account group for the material vendor and a separate account group for the carrier. Thus, these groups can be mapped to split categories as defined in Figure 10.

Custom Table for Account Determination for PPV Split Categories
For a particular split category, the vendor account group and material valuation class combination, define which account is used as a new PPV account and which ones are used for the original PPV posting (Figure 14). Use transaction SE16 or SM30 or follow menu path SAP Easy Access Menu > Tools > ABAP Workbench > Overview > SE16 - Data Browser > Enter Fifth Custom Table Name.

Figure 14
Custom table for account determination for PPV split categories
Now you can use these custom tables to develop a custom program based on the logic shown in Figure 15.

Figure 15
Custom program logic flow
Splitting of PPV
Businesses can create a custom program based on the logic flow shown in Figure 15. When such a custom program is executed, the PPV is split and reposted with the logic shown in this section. The logic explained in this section also explains how the different custom tables as shown earlier are used by the custom program. A developer can also assign this custom program to a custom transaction code.
Users can execute that custom transaction code or can execute the program using transaction SE38 or SA38 or following menu path SAP Easy Access Menu > Tools > ABAP Workbench > Development > SE38 - ABAP Editor.
PPV Split of the Original GR Accounting Document
If you refer back to Figure 7, the SAP system has posted the total PPV of CHF 1,200.00 into a single account. Now the objective is to split this PPV into the following components:
- CHF 1,000.00 belonging to material cost: The custom program uses the custom table shown in Figure 12 and classifies a WRX related to the Material Cost as CHF 2,000. The program also uses the custom table shown in Figure 11 to determine the cost component of the material (110 RM Aroma Chemicals as shown in Figure 3) CHF 1,000 as the Material Cost. The program then calculates the difference (CHF 1,000) of actual versus planned from the preceding two (CHF 2,000 minus CHF 1,000) and posts a new document using accounts from the custom table shown in Figure 14.
- CHF 200.00 belonging to delivery cost: The program uses the custom table shown in Figure 12 and classifies a ZFR related to the Delivery Cost as CHF 300. The program also uses the custom table shown in Figure 11 to determine the cost component of the material (210 Freight as shown in Figure 3) CHF 100 as the Material Cost. The program then calculates the difference (CHF 200) of actual versus planned from the preceding two (CHF 300 – CHF 200) and posts a new document using accounts from the custom table shown in Figure 14. The offset posting goes to the single offset account to counterbalance the original SAP GR posting (Figure 7), making that equal to the original PPV posting.
To display the accounting document, use transaction FB03. Populate the Document Number, Fiscal Year, and Company Code fields, and press Enter. When you execute the logic program, the PPV of CHF 1,200 is split correctly to show the PPV of CHF 1,000 to raw material cost and CHF 200 to delivery cost (Figure 16).

Figure 16
PPV split documents for GR
PPV Split of the Original IR Accounting Documents
If you refer back to Figures 8 and 9, the SAP system has posted the material vendor-related PPV of CHF 200.00 and carrier-related PPV of CHF 100 into the same account based on the setting shown earlier in Figure 4. This setting is common for any type of vendor. Now the objective is to repost these different PPVs to separate GL accounts.
The custom program uses the fourth custom table (Figure 13) and classifies the account group of the material vendor to the Material Cost category and the carrier to the Delivery Cost category. Then the program reposts the variance in the invoice to a new document using accounts defined in the fifth custom table (Figure 14).
To display the accounting document, use transaction FB03 or follow menu path SAP Easy Access Menu > Accounting > Financial Accounting > General Ledger > Document > FB03 - Display. Populate the Document Number, Fiscal Year, and Company Code fields, and press Enter. When you execute the logic program, the PPV of CHF 200.00 in original IR invoice for material vendor in Figure 8 is transferred to raw material PPV (Figure 17).

Figure 17
PPV split documents for material vendor IR
To display the accounting document, use transaction FB03 or follow menu path SAP Easy Access Menu > Accounting > Financial Accounting > General Ledger > Document > FB03 - Display. Populate the Document Number, Fiscal Year, and Company Code fields, and press Enter. When you execute the logic program, the PPV of CHF 100.00 in the original IR invoice for the carrier in Figure 9 is transferred to the delivery cost (Figure 18).

Figure 18
PPV split documents for the carrier IR
Reporting of Split PPV
Now I provide the overview in transaction FBL3N for amounts posted in the original PPV account 505612, new PPV accounts 505901 and 505903, and offset account 505904 in the preceding example. Use transaction FBL3N or follow SAP Easy Access Menu > Accounting > Financial Accounting > General Ledger > Account > FBL3N - Display/Change Line Items (Figure 19). Enter PPV-related account numbers and company code and click the execute icon.

Figure 19
Posting an overview of the entire flow of original costing and PPV splitting
The offset account (505904) counterbalances the original PPV postings (505612) and makes the total zero. The new PPV accounts show the split amount separately for the material cost (505901) and delivery cost (505903).
You can group the offset account and original PPV account in the financial statement version, and then it appears as zero in your financial statements, if you want to suppress the original split done by the PPV and to show the PPV as per new splitting only. The actual PPV appears via separate new PPV accounts, which show the correctly split PPV by this enhancement. Now you can monitor the PPV caused via various split categories and can take the appropriate control action.
Note
This concept is relevant for materials that are being valued at standard cost (price control indicator S in the material master). Materials being costed at moving average price are not relevant because no PPV occurs for those materials during posting.
Gaurav Agarwal
Gaurav Aggarwal is SAP S/4HANA lead consultant at Infosys Limited. He has more than 14 years of experience, including 11 years in SAP Finance. He has expertise in both SAP FI and Controlling (CO) with integration to other modules in manufacturing and process industries. He is a chartered accountant and SAP Certified Financial Consultant. He holds a bachelor’s degree in commerce and is a techno-functional expert with thorough knowledge of the necessary ABAP for functional experts. He is a veteran in G/L, AR, AP, banking, FA, Travel Management, and closing cockpit and has handled greenfield implementation, upgrades and conversions, rollouts, and support projects.
You may contact the author at gka2707@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.