Liquid UI - Documentation - 8.10 system.queryExists()

8.10 system.queryExists()


Purpose

With system.queryExists(), you can check if a file or folder exists in the specified script directory.


Syntax

system.queryExists("file/folder path");


Options

The system.queryExists command does not take any options.


User Interface

  1. Navigate to SAP Easy Access screen. Click enter button. You will get an error message indicating no file exists in the script directory.
     
  2. Place the required file in the script directory and then click enter button on the screen. All the material details are filed in the fields from the file located in the script directory.
     


Script Details

SAPLSMTR_NAVIGATION.E0100.sjs

function isBlank(jvar){
   return(jvar == null || jvar == "" || jvar == void(0));
}

function fileRead(){
   // Check if the file/folder exists or not and returns boolean
   if(!system.queryExists("C:\\LiquidUI\\Scripts\\file.txt")){
      message("E: Cannot find the file to be read");
      enter("?");
      goto SCRIPT_END;
   }

   openfile('file.txt', {"delimiter":","});
   READ:{
      readfile('file.txt', {"z_first_&V[idx]":true, "z_second_&V[idx]":true, "z_third_&V[idx]":true});
   }

   set("V[z_currField]" , "&V[z_first_&V[idx]]");
   if(isBlank(z_currField)) {
      goto FILE_END;
   }

   idx++;
   goto READ;
   FILE_END:;
   closefile('file.txt');
   SCRIPT_END:;
}

// User Interface
clearscreen();
pidx = 0;
idx=0;

text([0,0],  "Material" , {"size":20});
text([0,22],  "Item" , {"size":20});
text([0,44],  "Description" , {"size":20});

CREATE:{      
   inputfield([pidx + 1,0], {"size":20, "readonly":true, "name":"z_first_&V[pidx]" ,"nolabel":true});
   inputfield([pidx + 1,22], {"size":20, "readonly":true, "name":"z_second_&V[pidx]" ,"nolabel":true});
   inputfield([pidx + 1,44], {"size":20, "readonly":true, "name":"z_third_&V[pidx]" ,"nolabel":true});
}
pidx++;

set("V[z_checkfld]", "&V[z_first_&V[pidx]]");
if(isBlank(z_checkfld)){
   goto END;
}

goto CREATE;
END:;
pushbutton([1,67],"@0V@Enter","?",{"process":fileRead});

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