Discover how to enhance the Quality Management module so that it can handle the quality management of vendors based on the quality of the vendor’s manufacturers and suppliers. This check occurs when you create and update the purchase order. Learn about creating the ABAP Workbench objects in the system to activate this solution.
Key Concept
To meet production quality specifications, companies typically have agreements on quality standards with vendors about the deliveries of products from their suppliers. A standard SAP system supports this scenario using the manufacturers (a type of vendor) and manufacturer part numbers, but this solution is not flexible enough. Another method is based on the quality info record details of the vendor’s manufacturers or suppliers that influence the creation of the purchase orders. To implement the latter approach, you need to code and activate ABAP Workbench objects.
If your company needs to manage purchasing activities based on the quality of your main vendor’s manufacturers or goods suppliers, then you can implement Business Add-Ins (BAdIs) to take into account the quality info record (Q-info record) details in a given priority order. That is, the Q-info record details of the manufacturers have priority over the Q-info record details of the goods suppliers, which in turn have priority over the Q-info record details of the main vendor. This prioritization allows the company to manage the quality of the vendor’s deliveries at the time of the purchase order creation.
With standard SAP functionality, you cannot differentiate the quality of materials purchased from a vendor that sources materials from multiple manufacturers and good suppliers. The following scenario, which is based on my experience, shows how to enhance the quality management module using the ABAP Workbench so that you can assess the quality of materials when the vendor has more than one goods supplier.
In my example, there is one main vendor (called trading vendor) and a sub-vendor with multiple manufacturers that can provide the same material (powdered milk) to the company at its production site. The production site belongs to the Legal Entity YYY and is linked to the customer's trading site (Legal Entity XXX). The link is done in customizing as part of the enterprise structure preparation.
The fact that the company needs to manage its purchase orders based on the quality of the vendor’s suppliers or manufacturers makes the scenario complex from an SAP point of view. The sub-vendor has a purchase order created with the customer's trading plant, which is the plant of the main vendor. Information is stored in the purchase order PO (1).
The delivery should have the quality checks activated before it gets to the customer’s production site. The quality checks are activated based on the quality of the goods that the manufacturers supply to the sub-vendor. This information is stored in the purchase order PO (2).
I have implemented the following solution in the production environment for specific business cases in SAP materials management (MM) and quality management (QM) in SAP ERP Central Component (SAP ECC). However, the processes I describe also apply to previous versions of SAP ECC.
Figure 1 shows the overall scenario.
Figure 1
A customer's business scenario
In
Figure 1 note that the system link between the vendor, sub-vendor, material, and plant is done via Q-info records. The physical link (for deliveries) is between the sub-vendor and the customer's production site.
Customer's Business Requirements
My customer’s main business requirements were:
- Have the inspections triggered by the Q-info record of the sub-vendor, (that is, the goods supplier to the vendor). If the sub-vendor is certified, the purchase order should be created as usual. Otherwise, it is created, but blocked for further processing.
- Have the minimum master data maintained in the system (i.e., no manufacturing part numbers). If you introduce additional material master data to be maintained and create the purchase order using the manufacturer’s part number instead of common well-known materials, you have to do additional work. Usually, the material master in large corporations is managed centrally and in different SAP systems. This approach adds more steps in the whole logistics process in terms of organizational communications and technical procedures. Additionally, the local purchasing organization would object to managing purchase orders using manufacturer part numbers instead of the usual well-known material codes.
- Have the minimum impact on the current business in the purchasing or receiving area.
- Have full visibility of the business transactions using standard reports.
The Standard Solution in an SAP System
Although a standard SAP system offers a solution, it was not flexible enough to meet the business needs of my client. It uses the concept of manufacturer part number (MNP), manufacturer, and manufacturer's plants. It requires a series of changes in business processes, such as data entry and reporting, that my customer did not accept. Therefore, we turned to a custom solution.
We decided to investigate possible user exits in the materials management (MM) and quality management (QM) modules to fulfill the business requirements. In the end we decided to implement two methods of a Business Add-In (BAdI) used when creating and changing the purchase order.
Those methods check the status of the Q-info records of the vendor's partner function specified in the header details of the purchase orders (i.e., a goods supplier mapped in the system as GS).
When you create and change purchase orders, the system then performs the appropriate quality checks based on a given Q-info record priority (
Figure 2).
Figure 2
Logic of the enhancement
Note that per the standard SAP solution, the system checks only the status of the Q-info record created for the main vendor type VN material and plant combination. It does not consider the status of the vendor’s partner functions Q-info records.
Figure 2 shows the logic of these BAdIs. For example, consider a scenario in which you create or change a purchase order that includes a vendor and purchasing organization that has been defined in table ZIMM_CONS_DIR and the purchase order’s document type in table ZIQM_PO_DT. To evaluate the quality of the vendor’s deliveries, the system takes into account the Q-info record details of the vendor type GS, instead of the Q-info record of the vendor type VN. In this specific case, the system blocks the purchase order.
Workbench Activities
The first BAdI's method is used to enhance the creation of a purchase order. To enhance the creation of a purchase order, a developer can use transaction SE18 or follow menu path Tools > ABAP Workbench > Utilities > Business Add-Ins > Definition. The developer then double-clicks the method PROCESS_ITEM of the BAdI IF_EX_ME_PROCESS_PO_CUST (
Figure 3), to enter the ABAP coding based on the customer’s requirements, as shown in
Figure 2.
Figure 3
Method of the BAdI to enhance the purchase order creation
The method PROCESS_ITEM checks for a Q-info record for the material and GS vendor combination (if present) and throws an error accordingly. The error is an appropriate message for the type of error requested by the customer. In addition, it also checks the field's deletion flag and the release date in the Q-info record and throws an error accordingly. In my last two examples, the error messages could have been Q-Info Record flagged for deletion and Q-Info Record Release date not valid.
The second BAdI's method is used to enhance the updates of a purchase order. To enhance the updates of a purchase order, developers need to code these objects, which the functional consultant provides for them. Then the functional consultant tests and validates the developments. The developer can use transaction SE18 or follow menu path Tools > ABAP Workbench > Utilities > Business Add-Ins > Definition. Then the method CHECK of the BAdI IF_EX_ME_PROCESS_PO_CUST should be selected by double-clicking it, as shown in
Figure 4, and coded. In this case, the developer selects the method by double-clicking it and then adds the appropriate ABAP code.
Figure 4
Method of the BAdI to enhance the purchase order updates
The method CHECK does the same checks as the method PROCESS_ITEM. So when an end user updates the purchase order using the standard transaction ME22N, the system uses the method CHECK to validate the data that was entered.
These two methods are valid at the client level and are activated for transactions ME21N and ME22N. You need to make sure that the standard solution for vendor’s partner functions is not affected. You can do so by using custom objects instead of changing the standard ones.
I created two custom tables to trigger the methods. As shown in
Figure 2, these tables define the combination of data relevant to trigger the methods. In my example, the methods are triggered only for the vendor (100011) and purchasing organization (0004), and purchasing document type (Z001), as specified in
Tables 1 and
2, respectively.
Table 1
Define the vendors and purchasing organizations relevant for the methods
Table 2
Define the purchasing document types relevant for the methods
Master Data Maintenance in SAP
- Now that you have executed all related customizing activities correctly, I list the main master data steps needed as prerequisites for this solution.Maintain the vendor master data. To create the vendor, good suppliers, and manufacturers, use transaction XK01 or follow menu path Logistics > Materials Management > Purchasing > Master Data > Vendor > Central > Create. Then in the Partner Function tab page of the main vendor, define the relevant vendor’s manufacturers and goods suppliers (Figure 5).
Figure 5
Vendor master (Partner Functions view)
- Maintain the material master. To create the material, use transaction MM01 or follow menu path Logistics > Materials Management > Material Master > Material > Create (General) > Immediately. Select the Quality management view by clicking the Quality management tab (Figure 6).
Figure 6
The material master (Quality Management view)
You can see that the QM functionalities in the Procurement data section have been switched on at the client level by the check mark in the QM proc. active indicator. So based on the value stored in the QM Control Key (e.g., 0007), the quality management functionalities affect the procurement activities done in plant 0004.
To define the details of the QM Control Key, use customizing transaction OBQ or from the main SAP screen follow menu path Tools > Customizing > IMG > Execute Project > SAP Reference IMG > SAP Customizing Implementation Guide > Quality Management > QM in Logistics > QM in Procurement > Define Control Keys. In my example, the Control Key 0007 is relevant for quality releasing (
Figure 7). Thus, every vendor eligible to deliver that specific material should be released for quality via its Q-info record.
Figure 7
Customizing details of the confirmation Control Key (relevant for QM in procurement)
- Maintain the Q-info record. To create the Q-info record material, use transaction QI01 or follow menu path Logistics > Quality Management > Quality Planning > Logistics Master Data > Quality Info Record: Procurement > Create. Report the details of the Q-Info Record of the Trading Vendor (Figure 8) and Good Supplier (Figure 9). In Figure 8, the Q-Info Record for the Trading Vendor doesn’t have any block for procurement activities, so any purchase orders created for this vendor are not blocked for quality reasons.
Figure 8
Q-info record (main trading vendor)
In
Figure 9, the Q-Info Record for the Goods Supplier Vendor has a block for procurement activities. Therefore, any purchase orders created for this vendor are blocked for quality reasons.
Figure 9
Q-info record (goods supplier to the main vendor)
Transactional Data
To validate the first BAdI “PROCESS_ITEM “you have implemented, follow these steps:
Create a purchase order. Use transaction ME21N or follow menu path Logistics > Material Management > Purchasing > Purchase Order > Create > Vendor/Supplying Plant Known.
Enter the following data:
- The purchase order type (as specified in the table ZIMM_CONS_DIR)
- The main purchase order’s vendor is the Trading Vendor (as specified in table ZIMM_CONS_DIR)
- The purchasing organization of the vendor (as specified in the table ZIQM_PO_DT)
- The partner function details are defaulted from the vendor’s master (as defined in Figure 5)
- Goods to be procured
- Plant
- Quantity
- Price
In
Figure 10 you can see the details about the purchase order document type, purchasing organization, and main vendor (relevant for BAdIs). In
Figure 11, you can see the partner function details that have been defaulted from the main vendor’s master that are taken into account by the BAdIs via their Q-info records.
Figure 10
Purchase order creation (order type, purchasing organization, and vendor relevant for BAdIs)
Figure 11
Purchase order creation (partner function details)
The user exit (first method) is triggered by the fact that the GS Vendor and Purchasing Organization entered in the purchase order have been defined in table ZIMM_CONS_DIR. The purchasing document type has been specified in table ZIQM_PO_DT. Because of the quality of the vendor's goods supplier, specified in the Q-info record of the goods supplier, the system provides the message that procurement is blocked for quality reasons (
Figure 12).
Figure 12
Check of the user exit during the PO creation
Note that the same error messages are also provided if the Q-info record has been marked for deletion or if the release period has expired.
Note that to validate the second BAdI CHECK you have implemented, you should change a Purchase Order (created with the data relevant for the BADIs) using the transaction ME22N or follow the menu path: Logistics > Material Management > Purchasing > Purchase Order > Change.
The system performs the same checks already performed during the creation of the purchase order via BAdI PROCESS_ITEM.

Gaetano Altavilla
Dr. Gaetano Altavilla is a senior SAP practice manager. His focus is on pre-sales, delivery of SAP application solutions for large international corporations, and SAP knowledge management in Europe, the Middle East, and Africa (EMEA).
In his 18 years of SAP application experience working for many multinational companies, such as Procter & Gamble and Hewlett-Packard, he has covered a wide range of ERP logistic areas, focusing on the MM, WM, SD, LES, PP, PP-PI, PLM (QM, PM, PS) modules, as welll as CRM (TFM), SRM (EBP), SCM (SAP APO), and MES (ME) components.
Dr. Altavilla holds a degree with first-class honors in mathematics from the University of Naples and is certified in many SAP modules: SAP Logistics Bootcamp, SAP MM, SD, LE (SHP/WM/LE), PP, PLM (PM, QM, PS), SRM, CRM, SCM (APO), SCM (TM), FI, CO, and Solution Manager. He also has experience in ABAP/4 and application link enabling (ALE) and IDocs. He has participated in numerous industry conferences, such as the SAP Skills Conference in Walldorf at SAP SE.
You may contact the author at
Gaetano_altavilla@hotmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the
editor.