Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: openfile(), appendfile(), closefile(), readfile()
Purpose
This article guides you through how to attach the VB script to the SAP GUI using the applyscript command. This is demonstrated using the SAP Easy Access screen and will walk you through the following steps.
- Delete unnecessary elements on the SAP Easy Access screen
- Add a push button to initiate the process
- Add a VB script file
- Add a function to attach a VB file to your SAP GUI
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 all elements on the SAP Easy Access screen.
//Deletes all elements on the SAP Easy Access screen using clearscreen(). clearscreen();
- Add a push button labeled Display Image in Attachment to attach a .vbs script file to the Change Notification screen.
//Creates a push button labeled Display Image in Attachment, which executes a iw21_displayatt process pushbutton([3,17],"Display Image in Attachment" ,"/niw22",{"process":iw21_displayatt,"size":[1,30]});
- Add a test_apgs1.vbs file in your scripts folder.
- Add a function iw21_displayatt to attach a .vbs script file to the Change Notification screen using applyguiscript command.
//Creates a iw21_displayatt function to execute a series of steps on click. function iw21_displayatt(){ onscreen 'SAPLIQS0.0100' set("F[Notification]" , "10007338"); enter(); onscreen 'SAPLIQS0.7200' applyguiscript('test_apgs1.vbs'); onscreen '*' onscreen 'SAPLIQS0.7200' enter("/n"); }
SAP Process
- Refresh the screen, and Click Display Image in Attachment push button to execute the function. When a script attempts to access SAP GUI, you will receive a message from SAP, as shown below.
- Click on OK to attach the file. Once the attachment is confirmed, click OK.
Next Steps
Conversion of array data to grid data with to and fro navigation.
Learn how to display data in a grid from a data array.
Learn how to display data in a grid from a data array.
10 min.
This article is part of the Invoking functions tutorial.