Sub topic 11
Quality Management, Warehouse Management, and Classification views
This chapter assumes you know the organizational levels (client, plant, storage location, warehouse number) and how a material is created and extended in MM01. It also assumes you have read the earlier chapters on views. The three views here are optional. A material is complete without them, but they matter once a company uses inspections, classic warehouse management, or class-based search.
Why these views are "other" views
The Basic Data, Purchasing, MRP, and Accounting views are used by almost every material. The views in this chapter are different, because they only make sense if the matching component is in use. When you create a material, the "Select View(s)" dialog offers them only if the material type allows them and the organizational data you entered is valid for them.
| View | Organizational level | Main tables | Used by |
|---|---|---|---|
| Quality Management | Plant | MARC, QMAT | QM inspections |
| Warehouse Management 1 and 2 | Warehouse number, storage type | MLGN, MLGT | Classic WM |
| Classification | Client | INOB, KSSK, AUSP, KLAH, CABN | Search, variant configuration, batches |
Quality Management view
The QM view is stored at plant level. It tells the system how to inspect the material and whether QM takes part in procurement for it.
Typical fields:
- QM in procurement is active. When set, goods receipts and procurement documents for this material in this plant trigger QM functions. The plant must also be activated for QM in procurement in customizing. If either level is missing, the flag has no effect.
- QM control key. It decides whether a quality assurance agreement or a vendor release is needed before ordering and delivering.
- Certificate type. It states which vendor certificate is required with the delivery.
- Material authorization group. It restricts who may maintain QM data for the material.
- Inspection setup. This is a list of inspection types, such as 01 for goods receipt from procurement, 04 for goods receipt from production, and 03 for goods receipt from a production order. Each entry can be marked active and given parameters, for example whether results are recorded.
The inspection types are not columns of MARC. They live in table QMAT, with one row per material, plant, and inspection type. The "inspection setup" exists once at least one type has been created.
The two flags are often confused. QM in procurement being active is a general switch for the procurement process. An active inspection type is what creates an inspection lot for a given movement. A material can have QM in procurement active and still produce no inspection lot if no inspection type for goods receipt is active.
Warehouse Management views
Classic Warehouse Management (WM) manages stock inside a warehouse number, which is a level below the plant and storage location. Its data is kept in two views:
- Warehouse Management 1 holds data at warehouse number level: unit of issue, storage section indicator, stock placement and stock removal indicators, picking area, and bulk storage indicators.
- Warehouse Management 2 holds data at storage type level: minimum and maximum quantities, replenishment quantity, and control quantity.
The stock placement and stock removal indicators matter most. During putaway, the system reads the placement indicator and applies the putaway strategy of the storage types assigned to it. A material missing this indicator causes warehouse tasks to fail even though the plant data looks fine.
WM data is stored in MLGN (per material and warehouse number) and MLGT (per material, warehouse number, and storage type). Neither table has a plant field. The link to the plant goes through the storage location assignment to the warehouse number.
Be careful with WM in S/4HANA. SAP's strategic warehouse solution is embedded Extended Warehouse Management (EWM), which reads the same material master but keeps its own warehouse data. Classic WM is still available, but SAP's roadmap and simplification list are the authority on how long it is supported. Check them before you design a new implementation around the WM views.
Classification view
Classification lets you describe a material with characteristics that the standard fields do not cover, such as color, thread size, or hardness. It works with three objects:
- A characteristic (transaction CT04) is a property with allowed values, for example COLOR with the values RED and BLUE.
- A class (CL02) collects characteristics. Each class belongs to a class type. Class type 001 is the standard type for materials, and 023 is used for batches.
- An allocation assigns the material to a class and records its characteristic values.
The data is client-wide, so there is no plant or storage location in the classification view. The allocation is stored in KSSK, the values in AUSP, and INOB links the material (object table MARA) to an internal object number. The class is in KLAH and the characteristic in CABN.
Classification is useful in three ways. It supports searching: transaction CL30N finds all materials in a class whose characteristic values match your criteria. It supports variant configuration, where class type 300 and configurable materials are used. It also supports batch management, where batch classes describe the properties of each batch.
Reading the data with ABAP SQL
The program below reads the inspection setup and the warehouse data for one material. It follows the table design described above: QMAT is keyed by plant and inspection type, MLGN by warehouse number.
REPORT zdemo_mat_other_views.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY,
p_werks TYPE werks_d DEFAULT '1010'.
START-OF-SELECTION.
SELECT matnr, werks, art, aktiv
FROM qmat
WHERE matnr = @p_matnr
AND werks = @p_werks
INTO TABLE @DATA(lt_inspection).
SELECT matnr, lgnum, ltkze, ltkza, lgbkz
FROM mlgn
WHERE matnr = @p_matnr
INTO TABLE @DATA(lt_warehouse).
cl_demo_output=>new( )->write( lt_inspection
)->write( lt_warehouse
)->display( ).An empty lt_inspection means the QM view was never maintained for that plant, or no inspection type exists. An empty lt_warehouse means the material has not been extended to any warehouse number. Both are valid states and not errors.
For classification, avoid reading KSSK and AUSP directly in your own code. The keys are internal object numbers, and the value fields differ between character and numeric characteristics. Use the classification function modules and the standard APIs, which handle the conversion.
Common errors
- Inspection lot is not created. The usual causes are the plant not being active for QM in procurement, the inspection type not being active, or the QM control key not allowing the process. Check the plant setting first.
- Warehouse task cannot find a storage bin. The stock placement indicator in WM 1 is empty, or the storage type is not linked to that indicator in customizing.
- The view is not offered in MM01. The material type does not allow it, or you did not enter the organizational level it needs, such as a warehouse number.
- A class cannot be assigned. The class type is not allowed for the object table MARA, or the class belongs to a different class type than the one you selected.
- Missing authorization. The QM material authorization group, or the authorization object for classification, blocks the change. Look at the authorization trace in SU53.
Exercise
A material is extended to plant 1010 with QM in procurement active, but goods receipts create no inspection lot. Name two places to check and which table you would read to confirm the second one.
Show answer
First check that plant 1010 is activated for QM in procurement in customizing, because the material flag alone is not enough. Second, check that an inspection type for goods receipt, such as 01, exists and is active for the material. You can confirm that by reading table QMAT for the material and plant and looking at the inspection type and its active indicator.
Exercise
At which organizational level is classification data stored, and why can a material have different WM data in two warehouse numbers but only one set of classification values?
Show answer
Classification data is stored at client level, so it applies to the material as a whole. WM data is stored in MLGN and MLGT per warehouse number and storage type, so each warehouse number can have its own indicators and quantities.