Liquid UI - Documentation - 11.03 Display event performed using eventid option and _eventid system variable

11.03 Display event performed using eventid option and _eventid system variable


Prerequisites


Purpose

Learn how to use the pushbutton with eventid option to store a value and execute the code based on the event detected.  Using the _eventid system variable you can assign the eventid value for the pushbutton and access it. We will walk you through the following steps.

  1. Delete unnecessary screen elements on the SAP Easy Access screen using the del command
  2. Add two pushbuttons to view the details of events performed in the popup window.
  3. Add a conditional statement to check the eventid value and display a message
     
    Note: The pushbutton command with eventid option is supported on all Liquid UI Server releases beginning with 3.5.572.0
     

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

  1. Delete unnecessary screen elements on the SAP Easy Access screen using the del command.
     
    // Deletes Image Container and toolbar pushbuttons 
    del("X[IMAGE_CONTAINER]");
    // Deletes Documentation toolbar pushbutton del("P[Documentation]");
    // Deletes Assign Users toolbar pushbutton del("P[Assign Users]");
     

     
  2. Add two pushbuttons with labels as Get Order Details and Get Material Details to open the popup window with the relevant event details.
     
    // Creates Get Order Details and Get Material Details pushbuttons 
    pushbutton([2,4], "Get Order Details",{"eventid":"order"});
    // Creates Get Material Details pushbutton pushbutton([2,29], "Get Material Details",{"eventid":"material"});
     
     
  3. Add a conditional statement to check whether the eventid value is Order, and display the message based on it.
     
    // Creates conditional statement to check eventid value
    if(_eventid=='order') { message('You have Clicked on Get Order Details',{"title":"Event","type":64}); }
     
  4. Add a conditional statement to check whether the eventid value is Material and display the message based on it.
     
    // Creates conditional statement to check eventid value
    if(_eventid=='material') { message('You have Clicked on Get Material Details',{"title":"Event","type":64}); }
     
  5. Click the Get Order Details pushbutton to view the event performed in the popup window.
     
     
  6. Similarly, click the Get Material Details pushbutton to view the event performed in the popup window.
     
     


Next Steps

Get the system ID or database name using _database
Learn how to use the system ID or the database name of an SAP system.

5 min

This article is part of the Conditional scripts tutorial.


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