T-code

(Learn how and when to remove this template message)

A T-code is a transaction code used whenever executing particular task . Each function in SAP ERP has an SAP transaction code associated with it .

Use

A transaction code is used to access functions or running programs (including executing ABAP code)[1] in the SAP application more rapidly. By entering a t-code instead of using the menu, navigation and execution are combined into a single step, much like shortcuts in the Windows OS. SAP transaction codes can be entered into the Transaction code field to navigate the user directly to the screen or program task bypassing the SAP menu.

Example

Users can create a new session and start a new transaction in one step by entering /o followed by the transaction code e.g. /oFB60.[2]

Example Transaction codes

MM01 creation of Material Master

XK01(BP) Creation of Vendor Master

XD01(BP) creation of Customer Master

FB60 Accounts Payable Invoice Entry

FB65 Accounts Payable Credit Note Entry

FK10N Display Accounts Payable Balances

The transaction for MM module starts with M.

IH09 - Display Material MM01 - Create Material MM02 - Change Material MM03 - Display Material MM50 - List Extendable Materials MMBE - Stock Overview MMI1 - Create Operating Supplies MMN1 - Create Non-Stock Material MMS1 - Create Service MMU1 - Create Non-Valuated Material

ME51N - Create Purchase Requisition ME52N - Change Purchase Requisition ME53N - Display Purchase Requisition ME5A - Purchase Requisitions: List Display ME5J - Purchase Requisitions for Project ME5K - Requisitions by Account Assignment MELB - Purch. Transactions by Tracking No.

ME56 - Assign Source to Purch. Requisition ME57 - Assign and Process Requisitions ME58 - Ordering: Assigned Requisitions ME59 - Automatic Generation of POs

ME54 - Release Purchase Requisition ME55 - Collective Release of Purchase Reqs. ME5F - Release Reminder: Purch. Requisition

MB21 - Create Reservation MB22 - Change Reservation MB23 - Display Reservation MB24 - Reservations by Material MB25 - Reservations by Account Assignment

MB1C - Other Goods Receipts MB90 - Output Processing for Mat. Documents

MB21 - Create Reservation MB22 - Change Reservation MB23 - Display Reservation MB24 - Reservations by Material MB25 - Reservations by Account Assignment

MBRL - Return Delivery per Mat. Document

MB1C - Other Goods Receipts MB90 - Output Processing for Mat. Documents

MB1B - Transfer Posting

MIBC - ABC Analysis for Cycle Counting

MI01 - Create Physical Inventory Document MI02 - Change Physical Inventory Document MI03 - Display Physical Inventory Document MI31 - Batch Input: Create Phys. Inv. Doc. MI32 - Batch Input: Block Material MI33 - Batch Input: Freeze Book Inv.Balance MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons. MIQ1 - Batch Input: PhInvDoc. Project Stock

MI01 - Create Physical Inventory Document MI02 - Change Physical Inventory Document MI03 - Display Physical Inventory Document MI31 - Batch Input: Create Phys. Inv. Doc. MI32 - Batch Input: Block Material MI33 - Batch Input: Freeze Book Inv.Balance MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons. MIQ1 - Batch Input: PhInvDoc. Project Stock

MI01 - Create Physical Inventory Document MI02 - Change Physical Inventory Document MI03 - Display Physical Inventory Document MI31 - Batch Input: Create Phys. Inv. Doc. MI32 - Batch Input: Block Material MI33 - Batch Input: Freeze Book Inv.Balance MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons. MIQ1 - Batch Input: PhInvDoc. Project Stock

MI21 - Print physical inventory document

MI04 - Enter Inventory Count with Document MI05 - Change Inventory Count MI06 - Display Inventory Count MI09 - Enter Inventory Count w/o Document MI34 - Batch Input: Enter Count MI35 - Batch Input: Post Zero Stock Balance MI38 - Batch Input: Count and Differences MI39 - Batch Input: Document and Count MI40 - Batch Input: Doc., Count and Diff.

MI08 - Create List of Differences with Doc. MI10 - Create List of Differences w/o Doc. MI20 - Print List of Differences

MI11 - Physical Inventory Document Recount

MI07 - Process List of Differences MI37 - Batch Input: Post Differences

See also

References

  1. ^ Orosz, Tamas (2011). "Analysis of SAP Development tools and methods". 2011 15th IEEE International Conference on Intelligent Engineering Systems. IEEE. pp. 439–443. doi:10.1109/INES.2011.5954788. ISBN 978-1-4244-8954-1. S2CID 15070897. {{cite book}}: |journal= ignored (help)
  2. ^ "Practical SAP Training". Archived from the original on September 30, 2013. Retrieved 25 May 2023.{{cite web}}: CS1 maint: unfit URL (link)

Here's an example of a transaction code written in ABAP, which is a programming language used in SAP systems: ``àbap DATA: lv_sender_account TYPE string,

     lv_recipient_account TYPE string,
     lv_amount TYPE p DECIMALS 2.

lv_sender_account = '123456'. lv_recipient_account = '789012'. lv_amount = 100.00.

START-OF-SELECTION.

 PERFORM transfer_funds.

FORM transfer_funds.

 DATA: lv_success TYPE abap_bool.
 DATA: lt_account TYPE TABLE OF account,
       ls_sender TYPE account,
       ls_recipient TYPE account.
 SELECT * FROM account INTO TABLE lt_account
   WHERE account_number = lv_sender_account
      OR account_number = lv_recipient_account.
 READ TABLE lt_account WITH KEY account_number = lv_sender_account INTO ls_sender.
 READ TABLE lt_account WITH KEY account_number = lv_recipient_account INTO ls_recipient.
 IF ls_sender IS INITIAL OR ls_recipient IS INITIAL.
   WRITE: 'Invalid account number(s)'.
   EXIT.
 ENDIF.
 PERFORM deduct_amount USING: ls_sender-account_number, lv_amount CHANGING ls_sender-balance.
 PERFORM add_amount USING: ls_recipient-account_number, lv_amount CHANGING ls_recipient-balance.
 UPDATE account FROM TABLE lt_account.
 IF sy-subrc = 0.
   lv_success = abap_true.
 ENDIF.
 IF lv_success = abap_true.
   COMMIT WORK.
   WRITE: 'Transaction successful!'.
 ELSE.
   ROLLBACK WORK.
   WRITE: 'Transaction failed!'.
 ENDIF.

ENDFORM.

FORM deduct_amount USING p_account_number TYPE string

                          p_amount TYPE p DECIMALS 2
                    CHANGING p_balance TYPE p DECIMALS 2.
 LOOP AT lt_account ASSIGNING FIELD-SYMBOL(<ls_account>) WHERE account_number = p_account_number.
   <ls_account>-balance = <ls_account>-balance - p_amount.
 ENDLOOP.

ENDFORM.

FORM add_amount USING p_account_number TYPE string

                       p_amount TYPE p DECIMALS 2
                 CHANGING p_balance TYPE p DECIMALS 2.
 LOOP AT lt_account ASSIGNING FIELD-SYMBOL(<ls_account>) WHERE account_number = p_account_number.
   <ls_account>-balance = <ls_account>-balance + p_amount.
 ENDLOOP.

ENDFORM.

``` To run a transaction code (Tcode) in an SAP system, follow these steps:

   Log in to the SAP system using your user credentials.
   On the SAP Easy Access screen or the SAP Menu screen, locate the command field at the top of the screen. It is usually denoted by a magnifying glass icon or labeled as "Command" or "Tcode."
   Enter the desired Tcode into the command field. Tcodes are typically four characters long and consist of alphanumeric characters (e.g., "ME21N" or "FB50").
   Press Enter or click the green checkmark icon next to the command field.
   The SAP system will navigate to the transaction screen associated with the entered Tcode. This screen allows you to perform the specific task or process related to that Tcode.
   Fill in the required fields, select appropriate options, and provide necessary data as per the transaction's requirements.
   Once you have entered all the necessary information, click the save button (usually represented by a floppy disk icon) or choose an appropriate option to execute the transaction.
   The SAP system will process the transaction based on the entered data and display the relevant output or confirmation message.