Liquid UI - Documentation - 21.07 Validating SAP screen elements using isValid and isVisible options

21.07 Validating SAP screen elements using isValid and isVisible options


Prerequisites


Purpose

  • Learn how to validate the SAP screen elements using isValid and isVisible options.
  • Create pushbuttons to call the functions to check isValid and isVisible options.
 

To demonstrate the above aspects, we are considering the Goods Receipt Material Document screen as an example and we'll walk you through the following steps:

  1. Add two pushbuttons to call Isvalid_Check and IsVisible_Check functions
  2. Add a function to check the isValid option
  3. Add a function to check the isVisible option
 

isValid - With this option, you can determine whether or not an SAP screen element exists, even if it is not visible on the screen.

isVisible - With this option, you can determine whether or not the SAP screen element is visible in SAP GUI.

The following example shows how to validate SAP Screen elements using the isValid and isVisible options on the MIGO screen.

 

User Interface

//Create this file inside your script folder for customizing Good Receipt Material Document SAPLMIGO.E0001.sjs
//Now, let's start adding the Liquid UI script to the above file and save it.

 

Customization

  1. Log into SAP and navigate to the MIGO (Good Receipt Material Document).
     
     
  2. Add a toolbar pushbutton with the label Check IsValid to call the function Isvalid_Check when clicked.
     
    // Creates a toolbar pushbutton with the label Check IsValid Option to call a function when clicked.
    pushbutton([TOOLBAR]"Check isValid Option,"?",{"process":Isvalid_Check"});
    
     
     
  3. Add another toolbar pushbutton with the label Check IsVisible Option to call the function IsVisible_Check on click.
     
    // Creates a toolbar pushbutton with the label Check IsVisible Option to call a function when clicked. 
    pushbutton([TOOLBAR]"Check isVisible Option,"?",{"process":IsVisible_Check"});
     
     
  4. To check if the element is valid and visible on the MIGO screen, add the following Liquid UI script now, and then save the file.
     
     //function to check isValid option. 
    function Isvalid_Check(){
    if(<"F[GR/GI Slip No.]">.isValid){
    set('F"[GR/GI Slip No.]","100004541");
    }
    println("----- GR/GI Slip No. Field Exists -------",z_grgislipno);
    message("S: Field GR/GI Slip No. Exists and assigned value 100004541");
    }

    //function to check isVisibleoption
    function IsVisible_Check(){
    if(<"F[GR/GI Slip No.]">.isVisible){
    set('F"[GR/GI Slip No.]","");
    }
    println("----- GR/GI Slip No. Field is Visible -------",z_grgislipno);
    message("S: Field GR/GI Slip No. is Visible and set it to Blank");
    }
     

SAP Process

  1. Refresh the SAP screen, click the Check IsValid Option, and assign GR/GI Slip No. to 100004541. The success message Field GR/GI Slip No. Exists and assigned value 100004541 appears, as shown below.
     
     
  2. Refresh the SAP screen. Click the Check IsVisible Option to set GR/GI Slip No. input field to blank and displays a success message, Field GR/GI Slip No. is Visible and set it to Blank, as shown in the following image.
     
     

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