SAP Substantive testing for 3 Way Match
SAP substantive analytical procedures from start to end from the 3-way match perspective.
About SAP Substantive Testing / Analytical Procedure
Definition
For application controls perspective, Substantive Testing is an audit procedure that examines the financial transaction to see if a transaction has bypassed the controls. We don’t perform substantive testing of all the controls we test as part of application controls. Only those controls where Walk-through or Configuration testing fails at design or implementation level then we carry out substantive testing.
Why 3 Way Match substantive testing is Complex?
From 3-way match perspective, the substantive testing brings us new challenges which we don’t face in other controls substantive testing. Challenges mainly arise out of the volume of data and complexity of the tables from which data is to be extracted.
Before we begin
Before you continue reading this post on How to perform substantive testing for 3 way match in sap, I would recommend you read about – How 3-way match is tested in SAP here. You will get an idea of what configurations are required to be tested.
What are the steps that be perfomed?
- Defined on what grounds the 3-way match is failing
- Identify what data you need to check (based on 1 above)
- Identify tables where this data is stored
- Extract this tables. Link tables (if necessary)
- Analyse data extracted and conclude.
In this post, we are going to assume that 3-way match filled in all possible way. Hence we need to test each and every aspect of the 3 way match substantively.
Identifying Tables for Substantive Testing
Following is the list of tables for 3 way match testing
Technical Name | Description | Data Stored |
---|---|---|
EKKO | Purchase Order Header Data | PO Number, Date, Org Data (Company Code, Purchasing Org), Document Category and Type, Vendor, Currency and Exchange Rate |
EKPO | Purchase Order Line Item Data | Deletion Indicator, Material (Number, Group, Valuation Type) , Plant, PO Quantity, Rate, Amount, GR Based IV Check, Delivery Tolerance, GR Non Valuated. |
EKBE | Purchase Order History Line Item Data | Event Type (GRN / Invoice), Invoice details and GRN Details |
While tables – EKKO and EKPO are straight forward, EKBE is a complex table. We cannot directly use EKBE table.
Identifying Data to be extracted for Substantive Analytical procedures
Following are the fields with corresponding tables for 3 way match testing.
Table Name | Field Name | Field Description | My Comments | Link Tbl. | Sel. |
---|---|---|---|---|---|
EKKO | EBELN | Purchasing Document Number | |||
EKKO | BUKRS | Company Code | Company in Scope | Yes | |
EKKO | BSTYP | Purchasing Document Category | Only "F" | Yes | |
EKKO | BSART | Purchasing Document Type | Yes | ||
EKKO | LOEKZ | Deletion indicator in purchasing document | Exclude PO which are deleted | Yes | |
EKKO | STATU | Status of Purchasing Document | |||
EKKO | AEDAT | Date on which the record was created | It is System Generated Date | ||
EKKO | ERNAM | Name of Person who Created the Object | SAP User ID | ||
EKKO | LIFNR | Vendor's account number | LFA1 | ||
EKKO | ZTERM | Terms of payment key | |||
EKKO | EKORG | Purchasing organization | T024E | Yes | |
EKKO | EKGRP | Purchasing Group | T024 | Yes | |
EKKO | WAERS | Currency Key | TCURC | Yes | |
EKKO | WKURS | Exchange Rate | |||
EKKO | KUFIX | Indicator: Fixing of Exchange Rate | Yes | ||
EKKO | BEDAT | Purchasing Document Date | User entered Date | Yes | |
EKKO | LLIEF | Supplying Vendor | LFA1 | ||
EKKO | FRGGR | Release group | |||
EKKO | FRGSX | Release Strategy | T16FS | ||
EKKO | FRGKE | Release Indicator: Purchasing Document | |||
EKKO | FRGZU | Release status | |||
EKKO | FRGRL | Release Not Yet Completely Effected | |||
EKPO | EBELN | Purchasing Document Number | |||
EKPO | EBELP | Item Number of Purchasing Document | |||
EKPO | LOEKZ | Deletion indicator in purchasing document | Exclude PO lines which are deleted | ||
EKPO | MATNR | Material Number | |||
EKPO | WERKS | Plant | Can restrict testing to a Plant | T001W | Yes |
EKPO | MATKL | Material Group | Can restrict testing to a Material Group | T023 | Yes |
EKPO | MENGE | Purchase Order Quantity | |||
EKPO | MEINS | Order unit | T006 | ||
EKPO | BPRME | Order Price Unit (purchasing) | |||
EKPO | NETPR | Net Price in Purchasing Document (in Document Currency) | |||
EKPO | PEINH | Price unit | |||
EKPO | NETWR | Net Order Value in PO Currency | |||
EKPO | MWSKZ | Tax on sales/purchases code | |||
EKPO | INSMK | Stock Type | Restricted, Un restricted, Blocked | ||
EKPO | UEBTO | Overdelivery Tolerance Limit | |||
EKPO | ELIKZ | Delivery Completed" Indicator | |||
EKPO | EREKZ | Final Invoice Indicator | |||
EKPO | PSTYP | Item category in purchasing document | Service or Material or standard | Yes | |
EKPO | WEPOS | Goods Receipt Indicator | |||
EKPO | WEUNB | Goods Receipt, Non-Valuated | |||
EKPO | REPOS | Invoice receipt indicator | |||
EKPO | WEBRE | Indicator: GR-Based Invoice Verification | |||
EKBE | EBELN | Purchasing Document Number | EKKO | ||
EKBE | EBELP | Item Number of Purchasing Document | EKPO | ||
EKBE | VGABE | Transaction/event type, purchase order history | |||
EKBE | GJAHR | Year of material document | |||
EKBE | BELNR | Number of Material Document | GRN / Invoice Number Depending upon - BUZEI | ||
EKBE | BUZEI | Item in material document | |||
EKBE | BEWTP | Purchase Order History Category | T163B | ||
EKBE | BWART | Movement type (inventory management) | T156 | ||
EKBE | BUDAT | Posting Date in the Document | |||
EKBE | MENGE | Quantity | |||
EKBE | BPMNG | Quantity in purchase order price unit | |||
EKBE | DMBTR | Amount in local currency | |||
EKBE | WRBTR | Amount in document currency | |||
EKBE | WAERS | Currency Key | TCURC | ||
EKBE | AREWR | GR/IR account clearing value in local currency | |||
EKBE | SHKZG | Debit/Credit Indicator | |||
EKBE | REEWR | Invoice Value Entered (in Local Currency) | |||
EKBE | REFWR | Invoice Value in Foreign Currency | |||
EKBE | MWSKZ | Tax on sales/purchases code | |||
EKBE | AREWW | Clearing value on GR/IR clearing account (transac. currency) |
Note: PO Value in EKPO table, is calculated using below formula.
NETWR = NETPR / PEINH X MENGE [i.e. PO Line Value = PO Price / Pirce per X PO Price]
Data Extraction for Substative Testing of 3 Way Match
We have 2 options (TCodes) for extracting data 1st – SE16N 2nd – SQVI
The best option is to use SQVI, as it allows for one data extraction. If you don’t have access to SQVI, then use SE16N to extract one table and use this data as an input for another table. If data volume is more than a 50 thousand rows then SE16N may give ABAP error. Using SE16N we can only filter and extract data from one table. Using SQVI, we can filter based on one table and extract data of another table (of course as long as there is a link between these 2 tables).
Using SQVI
We need to extract 3 different data.
- EKKO (PO header) – Filter using Date, Company Code fields from EKKO table itself
- EKPO (PO Line) – Link EKKO and then filter Date, Company Code fields from EKKO
- EKBE (PO History) – Link EKPO, then Link EKKO and filter Date, Company Code fields from EKKO.
Analysis for Substative Testing of 3 Way Match
1. Invoice without GRN
In default SAP installation, a key field named “GR-Bsd IV” i.e. “Goods Receipt based Invoice” is editable at the time of PO by users. This is a cause for concern for auditors because this will enable users to create an invoice without GRN. The best case scenario for this configuration to be “Display only”, i.e. users should not be able to edit this field in Purchase Order. If the field is editable, we need to extract data and check whether any users have left it unchecked in any PO. The field is in EKPO table, Field Name – WEBRE.
Practically, we might find that this field is not ticked for some of the scenarios listed below
- Service PO. Check EKPO-PSTYP (Item category in purchasing document) to exclude “Service” Category.
- Import PO. Check EKKO-WAERS (Currency Key) to exclude Local Currency, or check EKKO-BSART (Purchasing Document Type) to exclude the PO document type used for Import PO.
- PO from Affiliate vendors. Check EKKO-LIFNR (Vendor’s account number) to Exclude 3rd party affiliated vendors or check EKKO-LLIEF (Supplying Vendor) to exclude
non -3rd party affiliated vendors. - Bulk low-value materials. Check EKPO-MATKL (Material Group) to exclude such type of materials.
2.Tolerance for GRN
Tolerance for GRN quantity is copied to PO from PO Configuration or from Material Master (if defined). At the time of PO, tolerance fields may be editable. If users change the tolerance fields in PO, then GRN can be created against that PO up to that tolerance. In best case scenario, the tolerance fields should not be editable in PO. If it is editable, then we need to extract data and check whether users have modified the tolerances. For the setting of tolerance in PO, we have 2 fields – UEBTO (Overdelivery Tolerance Limit ), UEBTK (Indicator: Unlimited Overdelivery Allowed). If UEBTK is ticked, then users can create GRN for any quantity.
In some cases, we might find that “Unlimited Overdelivery Allowed” indicator may be ticked.
- Service PO. Check EKPO-PSTYP (Item category in purchasing document) to exclude “Service” Category.
- PO from Affiliate vendors. Check EKKO-LIFNR (Vendor’s account number) to Exclude 3rd party affiliated vendors or check EKKO-LLIEF (Supplying Vendor) to exclude
non -3rd party affiliated vendors.
3.Tolerance for Invoice Price
Tolerance for invoice creation is dependent upon Receiving Invoice Configuration. In best case scenario, a system should not allow the price to be edited at the time of Invoice Booking (i.e. at the time of MIRO). If the system (SAP ERP) allows prices to be edited, then if the price entered is higher than PO, then invoice should not be allowed to be posted.
To sum up, we will test it substantively in following situations. 1st – Tolerance is not set. 2nd -Tolerance is set but Invoice is allowed to be posted for higher price/quantity. For testing this, we need to compare – PO Price vis a vis Invoice price
To calculate PO Price – NETPR / PEINH (i.e. Price divided by Per Unit) from EKPO table for each individual PO Line Item. This value is in PO Currency. Hence we need to compare Value in Foreign Currency only.
To calculate Invoice Price – REFWR / MENGE (i.e. Invoice Value in Foreign Currency divided by Invoice Quantity) from EKBE Table. This value will be in Foreign Currency. Hence will not be affected by Currency Fluctuations. Filter for only Invoice Transactions by using a filter on VGABE (Event Type) as 2 (Invoice). There can be multiple Invoice against the same PO, hence when comparing using Invoice price table as your base to compare PO price. In short, in EKBE table, use Vlookup to get values from EKPO table.
3.Tolerance for Invoice Quantity
Tolerance for invoice creation is dependent upon Receiving Invoice Configuration. If the quantity entered is higher than PO, then invoice should not be allowed to be posted. If the system allows Invoice quantity to be higher than GRN quantity then we need to test the control substantively. Thus we need to find cases where Invoice quantity is more than GRN quantity. For testing this, we need to compare – GRN Quantity vis a vis Invoice Quantity.
To calculate GRN Qty – From EKBE table calculate a sum of all MENGE (Quantity) based on BELNR (Material Document) per PO Number and PO Line Number. Filter on VGABE (Event Type) as 1 (GRN).
To calculate Invoice Qty – From EKBE table calculate a sum of all MENGE (Quantity) based on BELNR (Material Document) per PO Number and PO Line Number. Filter on VGABE (Event Type) as 2 (Invoice)
We cannot use MENGE directly to the sum as there can be cases of GRN being cancelled (i.e reversed). Hence we need to recalculate this filed taking into account Debit and Credit in Goods Movement. The same holds true for Invoice too. Thus before SUM, recalculation is based on SHKZG Field (Dr/Cr Indicator). If
Also, care needs to be taken to sum based on PO Number and PO Line number and NOT on Material Doc Line Number.
The best way to analyse this is to use Pivot Tables in Excel. Download Sample Excel file from here or Here
The primary key is “PO Number” and “PO Line Number”. Hence First we need to drag PO Doc number and PO Line Number into Row. Then To get the sum of quantity based on Material Document drag “Material Doc Num” to Row. We need to compare Invoice and GRN quantity, hence Drag “Event Type” to Columns. Finally to get sum of quantity, drag “calculated Qty” to Values.
I wish i could write that great of a post. Thanks for sharing your knowledge
Companies, non-profit and government agencies make use of requisition forms as a type of internal business document. They use it to notify of the ordering of products from an internal department or outside supplier. This form generally states the number of products required, the time frame, authorization for the item(s) and what should be done in case the items are not currently available.
Great post. I’m going to repost it for my followers.
Awesome post, In-depth coverage.
Great article.
Amazing article on sap substantive analytical procedures. Love it. Thanks for your in-depth knowledge sharing.
I really love to read this post and I am glad to find your distinguished way of writing the post. Thanks and Regards