Liquid UI - Documentation - 19.03 Attach VB script to SAP

19.03 Attach VB script to SAP


Prerequisites


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.

  1. Delete unnecessary elements on the SAP Easy Access screen
  2. Add a push button to initiate the process
  3. Add a VB script file
  4. 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

  1. Delete all elements on the SAP Easy Access screen.
     
    //Deletes all elements on the SAP Easy Access screen using clearscreen().
    clearscreen();
    
     
     
  2. 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]});
    
     
     
  3. Add a test_apgs1.vbs file in your scripts folder.
     
     
  4. 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

  1. 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.
     
     
  2. 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.
10 min.

This article is part of the Invoking functions tutorial.


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