Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: pushbutton(), message(), _eventid
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.
- Delete unnecessary screen elements on the SAP Easy Access screen using the del command
- Add two pushbuttons to view the details of events performed in the popup window.
- 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.
- 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]");
- 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"}); - 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}); } - 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}); } - Click the Get Order Details pushbutton to view the event performed in the popup window.
- 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.
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.