Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: inputfield(), enter(), pushbutton()
Purpose
To explain the dynamic navigation of transactions within SAP through functions. The following scenarios illustrate this process:
- Navigate to the required transaction by inputting the SAP module into the input field.
- Navigate to a specific transaction using push buttons.
Scenario 1:
To demonstrate navigation to the required transaction based on the SAP module entered in the input field, we’ll use the SAP Easy Access screen and will walk you through the following steps.
- Delete an image container on the SAP Easy Access screen
- Add an input field to enter the module
- Add a push button to navigate to a specified module
- Add a function to navigate to the Sales Order screen
- Add a function to navigate to the Create Material screen
- Display navigation through transactions based on the module chosen
User Interface
//Create this file inside your script folder for customizing the SAP Easy Access screen, SAPLSMTR_NAVIGATION.E0100.sjs
//Now, let's add the Liquid UI script to the above file and save it.
Customization
- Delete the image container on the SAP Easy Access screen using del().
// Deletes the image container del("X[IMAGE_CONTAINER]");
- Add an input field labeled Module to enter the module value.
// Creates an input field to enter the Module value inputfield([1,1],"Module:",[1,10],{"size":2,"name":"z_name"});
- Add a push button labeled RFC test to navigate to the module screen based on the value entered in the input field.
// Creates a push button to run the required function based on the value entered in the input field pushbutton([1,20],"RFC Test",{"process":['RFCTestFunc&V[z_name]']}});
- Add a function to navigate to the Create Sales Order: Initial Screen.
// function navigates to VA01 screen function RFCTestFuncSD() { enter('/nva01'); }
- Add a function to navigate to the Create Material (Initial Screen).
// function navigates to MM01 screen
function RFCTestFuncMM() { enter('/nmm01'); }
SAP Process
- Refresh the SAP Easy Access screen. Enter SD in the Module input field and click the RFC test push button. You will be navigated to the Create Sales Order: Initial Screen, as shown below.
- Similarly, enter PM and click the RFC test push button. You will be navigated to the Create Material (Initial Screen), as shown below.
Scenario 2:
In this use case, we will illustrate the process of invoking a function with varying parameter values based on the selection of a push button on the SAP Easy Access screen. The steps involved in this process are as follows:
- Delete the image container on the SAP Easy Access screen
- Add three push buttons for navigation
- Add a function to navigate to specific transactions
- Display navigation to specific transactions
User Interface
- Delete the image container on the SAP Easy Access screen using del().
// Deletes the image container del("X[IMAGE_CONTAINER]");
- Add three push buttons labeled VA01, MM01, and CS01 to navigate through transactions by passing parameter values to the specific function.
// Create pushbuttons with title, executes function on click where the eval function gets the myfunction variable value pushbutton([1,4], "VA01", "?", {"size":[2,20], "process":eval(myfunction), "using":{"l_screen":"VA01"}}); pushbutton([4,4], "MM01", "?", {"size":[2,20], "process":eval(myfunction), "using":{"l_screen":"MM01"}}); pushbutton([7,4], "CS01", "?", {"size":[2,20], "process":eval(myfunction), "using":{"l_screen":"CS01"}});
- Assign string value to a variable.
// Declare a variable var myfunction = "variableFunction";
- Add a function to navigate to the transaction based on the pushbutton clicked.
//Function to navigate to the required transaction based on the parameter value of the pushbutton clicked function variableFunction(param){ onscreen 'SAPLSMTR_NAVIGATION.0100' enter("/n"+param.l_screen); }
SAP Process
- Refresh the SAP Easy Access screen and click the VA01 push button to navigate through the Create Sales Order: Initial Screen.
- Similarly, clicking MM01 or CS01 will take you to the desired screens.
Next Steps
Learn how to add content in a file through the SAP GUI.
10 min.
This article is part of the Invoking functions tutorial.