SAP transaction codeObjectQS21ModuleQM

QS21 — Create Code Group (QM Catalog)

QS21 creates a code group, which is a named subdivision inside a QM catalog (for example the defect catalog or the usage decision catalog). A code group by itself holds no usable values; codes have to be added underneath it and the code group then has to be pulled into a selected set before it becomes visible anywhere in inspection processing or usage decision entry.

QS21 is the transaction for creating a code group under one of the QM catalog types, the layer between the catalog itself and the individual codes used in defect recording, usage decisions and inspection results. This page covers the real reasons a freshly created code group does not show up where a consultant expects it to, and how to prove in the data whether the problem is the code group, the codes, or the selected set that links them to a plant or inspection type.

Reviewed by an ERPClimb SAP consultant on 15 Sept 2026· 1,196 words

Purpose

QS21 creates a code group, which sits between the catalog (a fixed catalog type such as defect type, defect location, or usage decision code) and the codes themselves. A catalog type is delivered by SAP and is not something a consultant creates; code groups and codes underneath it are customer-maintained. The structural fact that causes most confusion: creating a code group in QS21 does not make it usable anywhere. It has to be populated with codes (transaction QS41 and related), and the code group then has to be included in a selected set (QS51 or QS52) that is assigned to a plant, inspection type, or catalog profile. Skipping that last step is the single most common reason a newly created code group is invisible in QA32, QE51N, or usage decision entry.

When it is used

QS21 is reached for during QM master data setup, not during transactional processing. Typical trigger: a plant wants a new set of defect codes for a specific material group, or a new usage decision code is needed for a scrapping reason that does not exist yet. A functional consultant builds the code group here, adds codes with QS41, then links the group into a selected set with QS51/QS52 and finally assigns that selected set at the inspection type or catalog profile level. QS21 is never used to record a defect or make a usage decision; that happens in QA32, QE51N, or the inspection lot itself, which only read the codes that were made reachable through this chain.

How to use it in practice

  • Call QS21 and select the catalog type first (e.g. 2 for damage/defect type, 3 for usage decision code) — this determines which catalog the code group belongs to
  • Enter the code group key and a short description in the logon language
  • Save; this creates the code group shell but not the codes under it
  • Switch to QS41 (or the equivalent code maintenance transaction) to add individual codes to the new code group
  • Use QS51 or QS52 to include the code group in a selected set
  • Assign that selected set to the relevant plant, inspection type, or catalog profile so the codes actually appear during results recording or usage decision

Key data objects

  • QPGR - code group master record: catalog type, code group key, validity, status/lock indicators
  • QPGRT - language-dependent text table for the code group description
  • QPCD - code master records created under a code group once QS41 is used
  • QPCDT - language-dependent text table for individual code descriptions
  • Selected set tables (maintained via QS51/QS52) - link code groups to the plants and inspection types where they are usable

How to prove it in the data

In SE16 on QPGR, filter by catalog type and code group key to confirm the group exists and check its validity dates and any deletion or lock flag. If the description looks blank to the end user, check QPGRT for a row in the user's logon language — a code group with only a German text and a user logged on in English will show up empty in F4 help. To prove a visibility problem is the selected set and not the code group itself, check the selected set assignment tables for the plant and inspection type in question and confirm the code group in question is actually listed there.

ECC vs S/4HANA

The catalog, code group, and code structure is unchanged between ECC and S/4HANA; QS21 behaves identically and the underlying customizing tables did not change. There is no dedicated Fiori app that replaces QS21 for code group maintenance; catalog and code group setup remains a SAP GUI, customizing-style activity in both worlds.

Common pitfalls and how to diagnose them

  • Code group created, nothing else: the group exists in QPGR but no codes were added via QS41 and no selected set references it. Symptom is an empty F4 help in results recording. Fix is not to touch QS21 again — go add codes and build the selected set link.
  • Wrong catalog type: the code group was created under the wrong catalog type (e.g. built as a defect location code when it needed to be a defect type code). It exists, has codes, but never appears where the process expects it because the consultant is looking in the wrong catalog branch. Check the catalog type field on QPGR before assuming the codes are missing.
  • Not in the selected set: the most frequent real-world cause of 'I created the codes and they still don't show up'. The code group and codes are correct but were never added to the selected set assigned to the relevant plant or inspection type. This is a QS51/QS52 problem, not a QS21 problem, and re-creating the code group does not fix it.
  • Language gap: the code group or its codes have text maintained only in the creator's language. Users in a different logon language see blank descriptions and assume the codes do not exist. Check QPGRT/QPCDT for the missing language row.
  • Validity period expired or not yet started: a code group with a 'valid from/to' window outside the current date silently disappears from selection lists. This is easy to miss because the group still exists and looks correctly built in QS23.
  • Deletion or lock indicator set: someone blocked the code group thinking it was obsolete, and it is now invisible everywhere it used to work. Check the status/lock flag on the code group record before rebuilding anything from scratch.

Whose problem this is

This is functional QM master data work, owned by the quality management consultant, not Basis or ABAP. The only Basis involvement is transporting the customizing entries (client-specific tables need a manual transport request, they do not move automatically with client copies). A good handover states the catalog type, the code group key, whether codes were added, and whether the group was already linked into a selected set — half of all 'codes missing' tickets trace back to that last step being skipped.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-tcodes/qs21ERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.