Liquid UI - Documentation - 10.16 Get the current window size using _windowsize_x and _windowsize_y

10.16 Get the current window size using _windowsize_x and _windowsize_y


Prerequisites


Purpose

Learn how to use the _windowsize system variable to retrieve either the width or the height of your SAP window in pixels.

  • The variable for width: _windowsize_x
  • The variable for height: _windowsize_y

 

 To demonstrate the above aspects, we will walk you through the following steps.

  1. Delete unnecessary elements on the SAP screen using the del command
  2. Add the webpage “https://www.guixt.com/” on the SAP screen using the view command
  3. Add title command

User Interface

//Create this file inside your script folder for adding functionality to 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.


Customization

  1. Logon to SAP and delete the image container using the del command on the SAP Easy Access screen, as shown below.
     
    // Deletes an image container on the easy access screen
    del("X[IMAGE_CONTAINER]");
     

     
  2. Add view command with coordinates to open the given webpage on the SAP Easy Access screen.
     
    // Opens Google web page on the SAP screen
    view([0,0],[x,y],"https://www.guixt.com/");
    
     
     
    Note: Available from WS Version 1.2.295.0 and Liquid UI Server Version 3.5.522.0 onwards!
     
  3. Add the title command to view the height and width of the webpage displayed on the SAP Easy Access screen.
     
    // Changes the SAP screen title 
    title("Width: "+_windowsize_x+", Heigth: "+_windowsize_y);
    y=_windowsize_x/7.4;
    x=(_windowsize_y+280)/38;
     

SAP Process

  1. Now, refresh the SAP Easy Access screen to view the width and height of the webpage displayed on the title bar. Also, you can view the change in the webpage size according to the change in your SAP window size, as shown below.
     
     

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