Liquid UI - WS Reference Library

setcursor


Prerequisites


Runs On

  SAP GUI Android iOS WM Web
Direct Connect          
Liquid UI Server Connect        

Purpose

With setcursor you can set the cursor into a certain input field. Below example explains on how to setcursor on appropriate fields.

User Interface


Set Cursor button will populate cursor on the required entry field.

Liquid UI Script

 //SAPLSMTR_NAVIGATION.E0100.sjs

// Code Sample: User Interface
inputfield( [2,3], "Plant", [2,15],{ "name":"z_plant", "size":4, "required":true});
inputfield( [3,3], "Material", [3,15],{ "name":"z_material", "size":10, "required":true});
inputfield( [4,3], "Stor Loc.", [4,15],{ "name":"z_storloc", "size":4, "required":true});
pushbutton([6,10], "Set Cursor", {"process":setCursor});

if(!isBlank(cursorPosition)) {
   setcursor(cursorPosition);
   cursorPosition = '';
} else {
   setcursor('V[z_plant]');
}

// Function to check required entry and setcursor on appropriate field
function setCursor(){
    if(isBlank(z_plant)){
         message('E: Please enter Plant');
         enter('?');
         goto END;
      }
       if(isBlank(z_material)){
         message('E: Please enter Material');
         set('V[cursorPosition]','V[z_material]');
         enter('?');
         goto END;
      }
       if(isBlank(z_storloc)){
         message('E: Please enter storage location');
         set('V[cursorPosition]','V[z_storloc]');
         enter('?');
         goto END;
      }
      
      END:;
   
}

//Function to check if the field value is blank or not
function isBlank(jvar) {
    if (jvar== void 0 || jvar==null || jvar=="") {
       return true;
    } else {
       return false;
    }
}