AGR_TCODES table — Transaction Codes Assigned to a Role
AGR_TCODES stores the transaction codes that have been added to a role's menu in PFCG. One row means one tcode is listed in one role, in one client. It does not mean the role's authorization actually lets a user run that tcode, and it does not mean any user has been assigned the role.
This page covers what AGR_TCODES actually records versus what people assume it proves, since the gap between menu assignment and real authorization is the source of most missing-access and phantom-access tickets. It also covers the joins needed to trace from a tcode complaint back to actual user access, and the pitfalls that lead to wrong conclusions during audits.
Reviewed by an ERPClimb SAP consultant on 15 Sept 2026· 918 words
What it stores
AGR_TCODES holds the transaction code entries that appear on the menu tab of a role in PFCG. Every time a tcode is added to a role's menu tree, PFCG writes a row here linking that role name to that tcode. A single role can have many rows, one per tcode on its menu. Composite roles are handled differently since their menu is built from the single roles they contain, so a composite role name may or may not carry its own direct entries depending on how it was built. The table is populated by role maintenance, not by execution, so it reflects design-time configuration rather than what a user actually ran or is entitled to run.
Key fields
- MANDT - client, always restrict on this first
- AGR_NAME - the role name the tcode is assigned to, single or composite
- TCODE - the transaction code entry as it appears on the role menu
How it joins the data model
- AGR_TCODES-AGR_NAME = AGR_USERS-AGR_NAME to find which users hold the role that carries the tcode
- AGR_TCODES-AGR_NAME = AGR_1251-AGR_NAME to see the authorization object values generated for that role
- AGR_TCODES-AGR_NAME = AGR_DEFINE-AGR_NAME to check the role's basic attributes and role type
- AGR_TCODES-TCODE = TACT-TCODE or the tcode's own master data to confirm the code is still active and not renamed
How to read it safely
The table can run into millions of rows in a large landscape because every role-tcode pairing is a separate row. Always filter on MANDT and then on either AGR_NAME or TCODE, never scan without one of those two. Selecting by TCODE alone across all roles is a legitimate and common query when the question is which roles expose a given tcode. Selecting by AGR_NAME alone is the right approach when the question is what a specific role's menu contains. Do not attempt to derive who can execute a tcode from this table alone; that requires the join through AGR_USERS and a check of the generated profile status.
How to prove it in the data
A user reports that transaction ZINV does not show up in their SAP Easy Access menu despite being told the role was assigned. Select AGR_TCODES for MANDT = client and TCODE = 'ZINV' to list every role that has that tcode on its menu. Cross-check the result against AGR_USERS for that user's assigned roles. If none of the user's roles appear in the AGR_TCODES result, the tcode was never added to the role menu, which is a role design gap, not an authorization or user master issue.
ECC vs S/4HANA
AGR_TCODES exists unchanged on S/4HANA. PFCG remains the tool for role maintenance and continues to write to this table exactly as it did in ECC. There is no compatibility view or restructuring known for this table; queries and reports built against it in ECC continue to work the same way after migration.
Common pitfalls
- A row in AGR_TCODES only proves the tcode is on the role's menu tree. It says nothing about whether the authorization objects behind that tcode were actually generated with usable values in AGR_1251, so a user can see or attempt the tcode and still be blocked by S_TCODE or an object check.
- The reverse trap is just as common: a tcode missing from AGR_TCODES does not mean the user cannot run it. If S_TCODE authorization for that code exists in the profile through another route, the user can start it via input in the command field even though it never appears in the menu tree.
- Composite roles do not always carry their own AGR_TCODES entries. Checking only the composite role name and concluding a tcode is absent is wrong if the tcode actually lives in one of the derived single roles.
- Removing a tcode from the role menu in PFCG does not automatically strip the related authorization values from AGR_1251. Stale authorizations can remain active until the role is regenerated, so absence from AGR_TCODES after a change is not proof that access was revoked.
- During access reviews, treating AGR_TCODES as a complete inventory of what a role can do ignores authorization checks that are not tied to a menu tcode at all, such as those enforced inside a program via explicit AUTHORITY-CHECK calls unrelated to the transaction start authorization.
Whose problem this is
Ownership sits with the security or access-governance team that maintains roles in PFCG, not with Basis and not with the functional module team requesting access. Any dispute about what a role's menu contains, or why a tcode was added or removed, is a role design decision that belongs to whoever governs the role catalog.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-tables/agr-tcodesERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.