Liquid UI - Documentation - 23.04 Changing script directory

23.04 Changing script directory


Prerequisites


Purpose

In this example, pushbuttons are used to change the current directory. This means the location of where the LiquidUI will look for the scripts will change when the button is clicked. This is useful for testing and even is used when implementing if the user wants to keep the scripts separate based on scenarios.


User Interface


Example1: Change script directory using pushbutton

Log in to SAP. Three buttons are displayed for the user, each changing the directory to another folder with another script inside it.


 

When “Sales Orders” is clicked:


 

When “Notifications” is clicked:


 

 When “Material Management” is clicked:


 

The structure of the directory is shown below:

 


Liquid UI Script

 C:\GuiXT\Tutorials\Forum\
clearscreen();
dirMain = 'C:\\GuiXT\\Tutorials\\Forum';
dirSalesOrders = dirMain +'\\SalesOrder\\';
dirNotifications = dirMain+'\\Notifications\\';
dirMaterials = dirMain +'\\Materials\\';
box([0,0],[4,109],"");
pushbutton([1,1],'@2V@Sales Orders','/nsession_manager/d1='+dirSalesOrders,{'size':[2,33]});
pushbutton([1,38],'@2Q@Notifications','/nsession_manager/d1='+dirNotifications,{'size':[2,33]}); pushbutton([1,76],'@2Z@Material Management','/nsession_manager/d1='+dirMaterials,{'size':[2,33]});
C:\GuiXT\Tutorials\Forum\Materials
clearscreen();
title("Material Management");
box([0,0],[5,109],"");
pushbutton([1,1],'Create Material','/nmm01',{'size':[2,33]});
pushbutton([1,38],'Change Material','/nmm02',{'size':[2,33]});
pushbutton([1,76],'Display Material','/nmm03',{'size':[2,33]});
pushbutton([4,38],'BACK','/nsession_manager/d1='+dirMain,{'size':[1,33]});
C:\GuiXT\Tutorials\Forum\SalesOrder
clearscreen();
title("Sales Orders");
box([0,0],[5,109],"");
pushbutton([1,1],'Create Sales Order','/nva01',{'size':[2,33]});
pushbutton([1,38],'Change Sales Order','/nva02',{'size':[2,33]});
pushbutton([1,76],'Display Sales Order','/nva03',{'size':[2,33]});
pushbutton([4,38],'BACK','/nsession_manager/d1='+dirMain,{'size':[1,33]});
C:\GuiXT\Tutorials\Forum\Notifications
clearscreen();
title("Notificaitons");
box([0,0],[5,109],"");
pushbutton([1,1],'Create Notification','/niw21',{'size':[2,33]});
pushbutton([1,38],'Change Notification','/niw22',{'size':[2,33]});
pushbutton([1,76],'Display Notification','/niw23',{'size':[2,33]});
pushbutton([4,38],'BACK','/nsession_manager/d1='+dirMain,{'size':[1,33]});


Example2: Change script directory at runtime


Purpose

You can execute particular transaction script file with different script saved in different script directories at the run time. You need to specify the directory path in the SAP command field(transaction field) to execute the script file. This avoids changing the script directory path manually in the guixt.sjs(configuration) file.


Syntax

The following syntax is used in the SAP command field.

/n[tcode]/dx=c:\\directoryname.

The script directory is specified by ‘dx’ where ‘x’ takes values of [1-4].


User Interface

  1. Enter the following code in the SAP command field(Transaction field) to execute the VA01 script file from the specified directory(c:\\liquidui\\scripts1).
     
    /nva01/d1=c:\\liquidui\\scripts1
  2. Enter the following code in the SAP command field(Transaction field) to execute the VA01 script file from the specified directory(c:\\liquidui\\scripts2).
     
    /nva01/d1=c:\\liquidui\\scripts2

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