Sub topic 10
Finding the transaction code for a task
This chapter assumes you can log on to SAP GUI, type a code into the command field, and use the SAP Easy Access menu. It also assumes you know how /n and /o work. Here you will learn how to go from a task ("I need to display a vendor") or a screen you are already on to the transaction code behind it.
Why this skill matters
A transaction code is much faster than a menu path. Menu paths also differ between roles, releases, and companies, so a colleague's directions ("go to Logistics, then...") may not match your menu. A code like XK03 works the same everywhere it is authorised.
There are two different situations:
- You are on a screen and want to know its code.
- You have a task in mind and want to find a code for it.
The methods differ, so this chapter treats them separately.
Method 1: read the code from the current screen
System > Status
If you reached a screen through the menu, a link, or a search, you can still find its code. Open System > Status. The dialog has a section called Repository data with these fields:
| Field | What it tells you |
|---|---|
| Transaction | The transaction code of the screen you are on |
| Program (screen) | The ABAP program that runs the screen |
| Screen number | The number of the current screen (dynpro) within that program |
| Program (GUI) | The program that owns the menu bar and toolbar |
| GUI status | The name of the menu bar and toolbar layout in use |
The Transaction field is the one you want. Copy it into your notes or your Favourites.
System > StatusThe Status dialog describes the session you were working in when you opened it. Open it from the screen you care about, not from the Easy Access menu.
The status bar
The status bar at the bottom right of the window has a small button that opens a menu of what to show. One choice is Transaction, which makes the current code appear permanently in the status bar. This is useful if you often write down codes or switch between transactions. The exact options vary slightly between SAP GUI versions, but the Transaction choice is available in current releases.
Technical names in the Easy Access menu
If you are still browsing the menu, you do not need to open the entry first. Turn on technical names in the menu settings (under Extras > Settings, tick Display technical names). Each entry then shows its transaction code next to its description. This is the easiest way to learn the codes for a whole area at once, such as everything under Accounting > Financial Accounting > Accounts Payable.
The previous chapter on menu navigation covers this setting in detail.
Method 2: search for a code by task
When you do not know where the task lives in the menu, search for the code directly. SAP stores all transaction codes in tables, and you can read those tables.
Search with the F4 help in SE93
Transaction SE93 (Maintain Transaction) is meant for developers, but its input field has a search help you can use in display mode.
- Enter
/nSE93. - Place the cursor in the Transaction code field and press F4.
- In the search help, filter by Short description with wildcards, such as
*vendor*. - Run the search and read the codes and descriptions in the result list.
Search the tables with SE16
If SE93 is not available to you, the Data Browser can do the same job. Two tables matter:
| Table | Content | Useful fields |
|---|---|---|
| TSTC | One row per transaction code | `TCODE`, `PGMNA` (program), `DYPNO` (screen number) |
| TSTCT | The descriptions of those codes, by language | `SPRSL` (language), `TCODE`, `TTEXT` (description) |
To search for codes by description:
- Enter
/nSE16. - Enter
TSTCTas the table name and press Enter. - In the selection screen, set
SPRSLto your logon language, for exampleEN. - In
TTEXT, enter a pattern with wildcards, such as*vendor*. - Run the search with F8.
/nSE16Use * as a wildcard for any run of characters. The search is case-sensitive in TTEXT, so *vendor* will not match "Display Vendor". Try both *endor* and *Vendor*, or use a short fragment that avoids the first letter.
Search by program
If you know the report or program name but not the code, search TSTC instead. Enter the program name in PGMNA. The result lists every transaction code that starts that program. Several codes can point to the same program, sometimes with different variants or default values.
Other ways to find a code
- Ask a colleague in the same role, or check your team's documentation. They may know a code and its authorisation requirements.
- Search the Customizing menu. Configuration tasks usually live in the Implementation Guide (
SPRO), not in the Easy Access menu. They often have no transaction code of their own. The path in the guide is the answer. - Use the SAP Help Portal. Product documentation often names the code for a task.
A decision flow
The following diagram shows which method to use in each situation.
A worked example
Suppose you have been asked to look up a customer's contact data, and you do not know the code.
- Open
/nSE16, enterTSTCT, and press Enter. - Set
SPRSLtoENandTTEXTto*Customer*, then press F8. - The list is long, so narrow it with a second search such as
*Display*Customer*. - You find an entry with a code and a description close to your task. Note the code.
- Enter
/nfollowed by that code and check that the screen matches your task. - Open System > Status and confirm that the Transaction field shows the code you typed.
Step 6 is worth the few seconds. The description in TSTCT is only a hint. Always start the transaction and check what it does before you add it to your Favourites or share it.
Gotchas and common errors
The code in Status is not always the one you expect
The Status dialog shows the code the current screen was started with. Some transactions are variants or parameter transactions. These are codes that start another transaction with preset values. A code you find can therefore lead to a screen with the same layout as a different code, but with different defaults. If two codes look like duplicates, compare them by the program name in Status or in TSTC.
Not every menu entry has a code
Some menu entries start a report, a web page, a Web Dynpro application, or an SAP Fiori app. These may have no transaction code at all, or may use a code that opens something in a browser. If technical names show nothing next to an entry, it is not a classic transaction.
Search results may include codes you cannot run
TSTC and TSTCT list every transaction in the system, not only those you may use. Finding a code does not mean you can start it. If you get a missing-authorisation message, a later chapter explains what to do next.
You may not be allowed to read the tables
Access to SE16 and to specific tables is controlled by authorisations. If SE16 or SE93 is blocked for you, use the menu method, Status, or ask a colleague. Do not look for ways around the restriction.
Language filters hide results
The TSTCT table has one row per code and language. If SPRSL is empty or set to a language the system has no texts for, you will see no results or the wrong language. Match it to your logon language.
Descriptions differ from menu text
The menu may show a customised or shortened label. TSTCT holds the standard description. If your search finds nothing, try a different word, a shorter fragment, or the English term.
Summary
- On a screen you already have, System > Status shows the code in the Transaction field.
- In the Easy Access menu, turning on technical names shows the codes next to the entries.
- For a task, search the F4 help in SE93 or the
TSTCTtable in SE16, using wildcards on the description. - To find codes for a known program, search
TSTCbyPGMNA. - Check what a code does before you save it or share it, and expect that some entries have no code or are not authorised for you.
Exercise
You are on a screen reached through a long menu path, and you want to add its transaction to your Favourites by code. Which menu path shows the code, and which field in the dialog contains it?
Show answer
Use System > Status. In the Repository data section, the Transaction field contains the transaction code of the current screen.
Exercise
You want to find every transaction whose description contains the word "Vendor" (with a capital V), and you cannot use SE93. Which table and fields do you use in SE16, and what selection values do you enter?
Show answer
Use table TSTCT. Set SPRSL to your logon language (for example EN) and TTEXT to Vendor. Press F8 to run the search. The TCODE column of the result lists the matching transaction codes. Wildcard searches on TTEXT are case-sensitive.
Exercise
You found two different transaction codes whose descriptions look alike. How can you tell whether they start the same program?
Show answer
Search table TSTC for each code and compare the PGMNA (program) and DYPNO (screen number) fields. You can also start each transaction and compare the Program (screen) and Screen number fields in System > Status. If they match, the codes probably differ only in variant or default values.