Author Topic: Opening Select File Dialog/Popup  (Read 5631 times)

Ashfaq Ahmed

  • Administrator
  • Newbie
  • *****
  • Posts: 32
    • View Profile
Opening Select File Dialog/Popup
« on: October 07, 2024, 03:33:42 PM »
Purpose: Opening Select File Pop-up:

When working with the File Dialog/Select File Pop-up in Liquid UI, errors like "primitive undefined" or "ActiveX Object class not registered" might occur. This article helps resolve these issues and demonstrates a simple, effective way to open the native Windows Select File Pop-up/Dialog in SAP.

Please follow the below steps:

Step-1: Open the Script file "SAPLSTMTR_NAVIGATION.E0100.sjs" or Create it if it is not present in the WS Directory as configured in the "guixt.sjs" file.

Step-2: Add the below Code Snippet and Save it.

//Deleting the Screen Controls
//Liquid UI Code:
del("X[IMAGE_CONTAINER]");

//Loading the Generic Functions
//This can also be placed in ESESSION.sjs file
load("FUNCTIONS_STRING.sjs");
load("FUNCTIONS_SECURITY.sjs"); 

//Function that will trigger the Select File Pop-up/Dialog
function fileopenfunc(){
   var dialog = new system.CommonDialog();
   dialog.ShowOpen();
   var ret = dialog.FileName;
   dialog = void 0;
   if(hasValue(ret)){
      message("S: File Selected = ",ret);
   }
   else{
      message("E: File Not Selected");
   }
}

//Design Screen
box([2,1], [5,33], "");
pushbutton([3,4], "@49@Select File", "?",{ "process":fileopenfunc , "size":[2,26]});


Refer to the Attachment for clarity....
« Last Edit: October 07, 2024, 03:49:39 PM by Ashfaq Ahmed »