Register Login

SAP OK Codes

Updated Aug 01, 2024

What is an SAP OK code?

An OK Code is used by a program to execute a function after a push button has been clicked. 

The term "OK codes" refers to specific commands that are entered in the SAP GUI's command field to carry out different tasks or regulate the behavior of the interface. Without the need for standard menu paths or transaction codes, they are utilized to control sessions, move between screens, and carry out particular tasks. 

Key Characteristics of OK Codes:

  • Session Management: OK codes can manage SAP GUI sessions, such as opening a new session or closing an existing one.
  • Direct Commands: They execute commands directly, such as switching on debugging mode or displaying the last authorization check.
  • Not Transaction-Specific: Unlike transaction codes, OK codes are not tied to specific SAP transactions but rather to actions within the SAP GUI.

List of OK Codes in SAP

Here are some commonly encountered OK codes in SAP:

  • /N: Exit the current transaction.
  • /O: Open a new session.
  • /I: Delete the current session.
  • /Nxxxx: Ends the current transaction and starts the specified transaction (replace 'xxxx' with the transaction code, e.g., /NVA01).
  • /Oxxxx: Opens a new session and starts the specified transaction.
  • /H: Switches on the debugging mode.
  • /NEX: Closes all sessions and logs off from the system.
  • /NSU53: Displays the last authorization check.
  • /NSE37: Calls Function Builder for a function module.
  • /NSE80: Calls Object Navigator (ABAP Workbench).
  • ENTER: Process the current input.
  • BACK: Navigate back to the previous screen.
  • CANCEL: Cancel the current operation.

Note: The specific OK codes and their functionalities can vary significantly based on the SAP module, transaction, and screen context.

How to find OK Codes in SAP?

An OK Code is used by a program to execute a function after a pushbutton has been clicked.

Please follow the steps below to find the OK Codes: 

  • First, go to the menu bar.    
  • Now in the menu bar go to System--->Status.
  • Click Gui Status.
  • Expand all the nodes inside you will get all Function Code / ok code for icons inside the GUI menu bar.

What is the difference between an OK code and a T-code?

An OK Code is used by a program to execute a function for example after a pushbutton has been clicked whereas A transaction code is a “shortcut” that helps a user run a program and is stored in table TSTC.

Aspect OK Codes T-Codes
Purpose Perform specific actions within a session Start specific transactions or applications
Usage Entered in the command field for session management (e.g., /N, /O, /H) Entered in the command field or selected from the SAP menu to access transaction screens (e.g., VA01, MB52, XK02)
Scope Session-oriented Function-oriented
Examples /N - Ends the current transaction
/O - Opens a new session
/H - Switches on debugging mode
/NEX - Closes all sessions and logs off
VA01 - Create Sales Order
MB52 - Display Warehouse Stocks for Material
XK02 - Change Vendor Master Data
SE80 - Object Navigator
Storage in Tables Not typically stored in standard SAP tables Stored in SAP tables for various purposes
Common Tables N/A TSTC - Contains all transaction codes
TSTCT - Contains descriptions of transaction codes in various languages

What are the shortcuts used in the OK-code box?

Shortcuts using the OK-code box:

  • %sc Search in page 
  • %pc Download do local file 
  • p+ Page up 
  • p- Page down 
  • p++ Top of page 
  • p-- End of page 


×