Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: set()
Purpose:
You will learn how to find the position of the values in the indexed variable and display them. Here, the set command will assign indexed variable values into a temporary variable. You can access and display the temporary variable values in the console window. We will walk you through the following steps.
- Delete unnecessary elements
- Add an array with material numbers
//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
- Delete redundant/unneeded screen elements on the SAP Easy Access screen.
del("X[IMAGE_CONTAINER]");
- Add an array with material numbers.
// array with material numbers materialnumber = ["1001","1002","1003","1004","1005"];
- Add a for loop to display materials at their position in the array. Here, we used set command to assign material number in the array to a temporary variable(z-temp).
for(idx=0;idx<5;idx++){ // assigning values to temp variable using index set("V[z_temp]" , materialnumber[idx]); // conditions for checking value in temp variable if (z_temp == "1005") { println("Material at 5th position in materialnumber array>>>" +z_temp); } if (z_temp == "1004") { println("Material at 4th position in materialnumber array>>>" +z_temp); } if (z_temp == "1003") { println("Material at 3th position in materialnumber array>>>" +z_temp); } if (z_temp == "1002") { println("Material at 2th position in materialnumber array>>>" +z_temp); } if (z_temp == "1001") { println("Material at 1th position in materialnumber array>>>" +z_temp); } }
- Navigate to SAP Easy Access screen. The material numbers with their positions in the indexed variable is displayed as shown in the console window.