Sub topic 2
What a transaction code is
This chapter explains what a transaction code is, how it relates to the screen or program it starts, and where it fits in SAP GUI. It assumes you have a working SAP GUI logon, know your way around desktop windows and menus, and have authorisation for a few common transactions. Later chapters cover the command field, the Easy Access menu, and Favourites in detail. Here the focus is the idea behind the code.
The working model
A transaction code (often called a t-code) is a short name that SAP uses to start one specific task. Examples are SU3 for your own user data, SE16 for the Data Browser, and VA01 for creating a sales order.
The code is not the task itself. It is a key in a table. SAP looks the key up and finds out what to start and how. In practice a transaction code ties together three things:
- A name. Up to 20 characters, such as
SU3orVA01. Customer-defined codes usually start withZorY, or sit in a customer namespace. - A target. Usually a program together with the screen (called a dynpro) it should show first. Other targets exist, such as a report, a query, or a call to a web or object-based application.
- Authorisation checks. The code can require that your user has a matching authorisation before the target starts.
This is why two people can type the same code and see different things happen: the code is the same, but their authorisations and defaults are not.
Transaction, program, and screen
Three terms are easy to mix up, so it helps to keep them apart.
| Term | What it is | Example |
|---|---|---|
| Transaction code | The short name you type or click | `SE16` |
| Program | The ABAP code that does the work | `SAPLSETB` and related programs |
| Screen (dynpro) | A single window layout that belongs to a program | The first Data Browser entry screen |
One program can have many screens. One program can also be reachable through several transaction codes, each starting it with a different first screen or different settings. Going the other way, each transaction code starts exactly one target.
The word "transaction" has a technical meaning in databases (a unit of work that is saved completely or not at all). In SAP GUI conversation it mostly means "something you can start by code". A transaction in this sense can be display-only, so nothing needs to be saved.
Reading a code
Most codes are abbreviations, and many are not meant to be guessed. Some patterns do help.
- Module prefixes. In standard SAP, the first letters often point to an area.
VAis sales,MEis purchasing,FBis financial accounting,MMis materials management, andSEis the ABAP development workbench. - Number suffixes. In many families,
01creates,02changes, and03displays.VA01,VA02, andVA03are create, change, and display sales order. - Short basis codes. System and user tools often have short codes, such as
SU3(own user data),SM04(user list), orSU53(display authorisation check result).
These are conventions, not rules. Do not assume that XX03 exists because XX01 does, and do not assume a code means the same thing in every system. Always confirm what a code does before you use it in a production system.
Where you use a code
You meet transaction codes in several places, and it helps to recognise them all:
- The command field. You type the code and press Enter. This is the fastest way once you know the code.
- The Easy Access menu. Each menu entry that starts a task is linked to a transaction code. You can click it without knowing the code.
- Favourites. An entry in your Favourites is a stored link to a code.
- Desktop shortcuts. A shortcut file can contain a system, a client, and a code to start directly.
- Documentation and support. Colleagues, guides, and tickets usually quote the code because it is short and unambiguous.
Because the code is the common key behind all of these, learning to read and look up codes pays off everywhere else in SAP GUI.
Trying it out
Open SAP GUI and log on. In the command field in the standard toolbar, enter:
SU3Press Enter. SAP starts the transaction that shows your own user data and defaults. The title bar shows the name of the screen, not the code. The status bar at the bottom can show the code if you configure it, and a later chapter covers how to find the code of any screen you reach through the menu.
Now return to the start screen with:
/nPress Enter again. The /n prefix is explained in the next chapters. For now, treat it as "leave this transaction".
To see the code of the screen you are on, use this menu path:
System > StatusThe dialog lists the transaction code, the program name, and the screen number. This is a useful way to see all three terms from the table above at once.
Case and format
Transaction codes are not case sensitive in the command field. su3, Su3, and SU3 all start the same transaction. SAP stores and shows codes in upper case.
A code is not the same as a menu path. The menu path is the route you click, and it can differ between users because menus are role-based. The code behind the final entry is the same for everyone.
Some entries in menus do not carry a transaction code at all. They may start a report, a web page, or a folder of entries instead. If an entry has no code, you will not see one next to it even with technical names switched on.
Common errors
Most problems with codes fall into a few groups. Read the message in the status bar first, because it usually tells you which one you have.
| Message or symptom | Likely cause | What to do |
|---|---|---|
| "Transaction XYZ does not exist" | A typing error, or the code does not exist in this system | Check the spelling. Try a search by task description. Codes can differ between systems |
| "You are not authorised to use transaction XYZ" | Your user lacks the authorisation for that code | Note the code and ask your authorisation administrator. Do not look for a workaround |
| The code starts but a screen field is empty or greyed out | A second, field-level authorisation check or a different mode, such as display | Check whether you used the display variant of the code |
| The code starts something unexpected | A custom code with the same purpose as a standard one, or a typo that matches another real code | Read the screen title and use System > Status to confirm |
| A colleague's code does not work for you | A different system, different release, or different role | Compare system and client in the logon, then ask the colleague which system they used |
A missing authorisation is a normal result, not a fault in the system. It is covered in its own chapter near the end of this tutorial.
Edge cases
- Custom codes. Companies add their own codes for local tasks. These usually begin with
ZorY. They exist only in your landscape, so you cannot look them up in public SAP documentation. - Same code, different system. Development, test, and production systems normally share the same codes, but a code may exist in one and not yet in another until a change has been transported.
- Parameter codes. Some codes start a general program with preset values. Two codes that look unrelated may therefore open the same program with different defaults.
- Obsolete codes. Releases replace old transactions. An old code can still work, redirect to a newer one, or be gone. If a guide is old, check the code before you trust it.
- Codes with no menu entry. A code can work even if no menu in your role shows it. Menu visibility and authorisation are separate things.
Exercises
Exercise
Name the three things a transaction code ties together, and say which of them can differ between two users who type the same code.
Show answer
A transaction code ties together a name, a target (usually a program and its first screen), and authorisation checks. The authorisation outcome can differ between two users, so the same code may start for one user and be refused for another. User defaults can also differ, so the content of the screen can vary.
Exercise
You reached a task through the Easy Access menu and need to report its transaction code to a colleague. How do you find it, and what else does that dialog show?
Show answer
Use the menu path System > Status. The dialog shows the transaction code, plus the program name and the screen number of the current screen.
Exercise
You enter a code from an old guide and get "Transaction does not exist". List two possible reasons that are not a typing error.
Show answer
The code may be obsolete in your release, or it may be a custom code that exists in a different system or has not been transported to yours. A different system or release from the one the guide describes is the common cause.