Liquid UI - Documentation - 10.18 Get the system ID or database name using _database

10.18 Get the system ID or database name using _database


Prerequisites


Purpose

You will learn how to retrieve database name of your SAP server using "_database" system variable. This system variable holds database name or system ID in the string format. This can be useful to conditionalize scripts based on the system ID. The script might need to modify, based on QAS system versus the PRD system. We will walk you through the following steps.

  1. Add a condition to check the system ID value.

//Create this file inside your script folder for customizing SAP Easy Access screen: SAPLSMTR_NAVIGATION.E0100.sjs
//Now let's start adding the content to the above file.

  1. Add a condition to check the system ID to change the screen title.
     
    // If the system ID value is TR1, then the screen title will change as ZEUS

    if(_database == "TR1"){
    title("Welcome to ZEUS");
    }

    // If the system ID value is TRX, then the screen title will change as JUNEAU

    else if(_database == "TRX"){
    title("Welcome to JUNEAU");
    }

    // If the system ID value is ID7, then the screen title will change as ORION

    else if(_database == "ID7"){
    title("Welcome to ORION");
    }

     
  2. You will enter into ZEUS SAP server if the system ID is TR1.
     

     
  3. You will enter into JUNEAU SAP server if the system ID is TRX.
     

     


Next Steps

Get transaction name using _transaction
Learn how to retrieve the transaction name and customize the screen based on the transaction.

5 min

This article is part of the Conditional scripts tutorial.


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