Liquid UI - Documentation - 10.19 Get transaction name using _transaction

10.19 Get transaction name using _transaction


Prerequisites


Purpose

You will learn how to retrieve transaction name of your SAP server using "_transaction" system variable. This system variable holds a string value of what transaction is being used. This variable is very useful when you want a script to run only in a certain transaction. We will walk you through the following steps.

  1. Add a condition to check the transaction name.

//Create this file inside your script folder for customizing Change Sales Order screen SAPMV45A.E0102.sjs
//Now let's start adding the content to the above file.

  1.  Add a condition to check the transaction as VA02 to delete the unnecessary screen elements and change the title of the screen as ON VA02.
    // If the transaction is VA02, execute the following
    if(_transaction == "VA02")
    {
    // edit the title
    title("ON VA02");
    // delete the pushbuttons we don't want for VA02
    del("P[Sales]");
    del("P[Item overview]");
    del("P[Ordering party");
    del("P[Orders]");
    }

     
  2. Add a condition to check the transaction as VA03 to delete the unnecessary screen elements and change the title of the screen as ON VA03.
    //If the transaction is VA03, execute the following
    else if(_transaction == "VA03")
    {
    // edit the title
    title("ON VA03");
    // delete the groupbox we dont want
    del("G[Search Criteria]");
    }

     


Next Steps

Validate time format, hh:mm:ss
Learn how to validate time format entered in an input field.

5 min

This article is part of the Conditional scripts tutorial.


Can't find the answers you're looking for?