Play the video to get introduced to the purpose of codes in SAP S/4HANA Quality Management.
Using Coded Values
The following image shows an example how you describe a defect using coded values:

When the Quality Technician performs a quality inspection and rejects a characteristic due to a defect, they want to describe the defect to initiate, for example, corrective actions. They could either describe the defect in freetext format (which is cumbersome), or select the type of defect from a predefined list (which much quicker). To do so, the Quality Planner creates a list of possible defect values, for example cracked, warped, scratched, damaged, and so on in the SAP S/4HANA system. Each defect has a (language dependent) short text and a long text description as well as a technical key for identification purposes (for example 1001 = Cracked, 1002 = Damaged, and so on).
When inspecting a qualitative characteristic, for example "Which packaging material was used?", the Quality Technician also selects the inspection result from a predefined list, for example, paper, plastic foil, wood wool, no packaging material and so on, set up by the Quality Planner.
In SAP S/4HANA, the Quality Planner uses catalogs to define, manage, and standardize such information consistently for all clients or plants. If you use catalogs, it is easier to record results for qualitative inspections ("Which packaging material was used?) and describe defects ("What type of defect did you detect?"). Subsequent evaluation is also easier when you use catalog data instead of free text.
The following image shows an example how the Quality Planner defines a list of possible defects:

The kind of defect (for example "picture not centered", "picture distorted", and so on) is represented by a coded value (code 1, code 2, and so on). To group similar defects together, the Quality Planner assigns them to a code group (for example "monitor", "surface", and so on). Each code group can have multiple codes. To furthermore define the context in which a code will be used, the Quality Planner assigns the codes and the code groups to a catalog. In SAP standard, define all defects in catalog type 9 (→ Defect types).
Hint
The codes contained in a code group are sorted alphanumerically. Therefore, we recommend to use leading zeros when you define the codes and want them to be sorted.
During quality inspection, when the Quality Technician records a defect, the system only shows values from the catalog type 9. If the Quality Planner set the indicator Defects Recording in the master inspection characteristic, they can enter a default defect code in the master inspection characteristic and the system automatically creates a defect using this code when the characteristic is rejected. If the Planner has not predefined a code in the characteristic, the system shows a pop-up from which the Quality Technician selects an appropriate code. Note that they can always create additional defects once they detect them.
The following image shows an example how the Quality Planner defines a list of possible attributes for quality inspections in the catalog type 1.

Again, they define a list of coded values (for example "clear", "frosted", "white", "red", and so on) and assign them to a code group (for example "surface attributes", "colors", and so on). When defining an inspection characteristic in the inspection plan or a master inspection characteristic, the Quality Planner assigns the code group containing the possible outcomes to the characteristic. In SAP standard, define characteristic attributes in catalog type 1 (→ Characteristic attributes).
Note
To be more precise, they assign a selected set which groups codes from different code groups together. We'll discuss selected sets in the next section.
During result recording, the Quality Technician selects a value from that predefined list. For example, the Technician inspects the characteristic "Surface of LED lamp". The Quality Technician defined that the code values clear, and frosted are possible, and the Technician selects the appropriate value.
As you've just learned, coding is used in inspection processing to describe characteristic attributes and defects. However, there are additional use cases in the SAP S/4HANA system where codes are used:
Usage decisions: When the Quality Engineer completes an inspection lot with a usage decision, they select a coded value.
Notification processing: When a Quality Technician creates a quality notification, they codify the notification subject. When the Quality Engineer later enriches the notification by defects and root causes or defines corrective actions or tasks, they also select a coded value to describe the defect, root cause, task, or action.
Failure Mode and Effects Analysis (FMEA): If the catalog of defect types that you use for the FMEA matches the catalog that you use for problem notification (quality notifications), you can compare the possible defects adopted in the FMEA with the defect types from actual problem notification. You can also amend the defects as required.
Nonconformance Management: The Quality Technician and Engineer use codes for defects recording, task definition and processing, and problem-solving processes (for example 8D).
How to Define Code Groups and Codes in Catalogs
The following image shows which catalog type is used for which use case in SAP S/4HANA Quality Management:

The catalog type is maintained in Customizing by the Application Consultant (IMG: Quality Management → Quality Notifications → Notification Creation → Notification Content → Maintain Catalogs.
The Quality Planner maintains code groups and codes in the app Edit Code Groups. You can enter the description for codes and the description for code groups several languages.
Note
In the transaction, choose Menu → Utilities → Choose languages to select the required languages.
Then select Menu → Edit → Translation to translate the corresponding entries.
The following screenshots show how the Quality Planner maintains coded entries using the Edit Code Groups app:


After entering a code group (for example Packaging materials for lamps), they enter the possible values (for example Paper, Plastic, and so on) in the next screen.
Note
For more information on catalogs and codes, refer to the Application Help.
Copy Function for Codes and Code Groups
To facilitate the creation of new codes, the Quality Planner can copy code groups with their corresponding codes. They can use the Copy as function to copy existing code groups, codes, selected sets, or set codes. They can use this function to create new code groups within a catalog, new selected sets within a plant, new codes within a code group, and new set codes within a selected set.
Deactivation of Codes
You can deactivate codes that you have already used in documents by setting a respective flag on the code level in Edit Code Groups (→ see next screenshot). Deactivated codes are no longer available in the input help and can no longer be assigned manually either. However, even after deactivation, the codes and their long texts and assigned documents are still available as selection criteria in reports.
How to use Document Integration for Codes
You can store additional information for codes and use the documents as a decision criterion for selecting codes. For example, you can provide examples for defects or attributes to help the Quality Technician select the correct values during result recording.
Technically, the Quality Planner assigns documents from the SAP Document Management System to codes when editing codes and code groups. You can display the assigned documents in all of the applications in which codes are used (for example, in results recording, in the usage decision, and when processing quality notifications). The following screenshots show an example how the Quality Planner links a document to a code using the app Edit Code Groups:

In the example, the Quality Planner uses the app Edit code Groups to link a code to a document. As shown in the screenshot, the Quality Planner can either assign documents to one or multiple codes.
To enable document integration for codes, the Application Consultant must make the following settings in customizing:
In Customizing for Document Management under Quality Management → Environment → Central Functions → Define Document Types, at least one document type was defined that allows the assignment of codes (object QPCD for object link). For the object link, the screen number 500 must be specified.
In Customizing for Quality Management under Quality Management → Basic Settings → Maintain Settings at Client Level: Further Settings, the Document Link to Code switch was activated for the business process Inspection Master Data Processing.
Note
The assignment of document records to codes is not a Customizing setting and does not have a Customizing transport link since document records are master data in SAP S/4HANA.