The logon script file is used to contain any functions or commands that need to be loaded at logon. This file is not required for a WS implementation, but it is good practice to use it if you have elements that need to be loaded or called at logon time. Anything contained in the logon script file will be used universally in your scripts - it is not restricted to a single session. An example logon script file is shown below.
load('wsoffice'); load('functionsSystem.sjs'); function getFilesToUpload(szPrompt) { if(szPrompt==void 0) szPrompt = 'Select File'; var dialog = new ActiveXObject('MsComDlg.CommonDialog'); dialog.Filter='All Files(*.*)|*.*'; dialog.MaxFileSize=32767; //dialog.AllowMultiSelect = true; dialog.DialogTitle=szPrompt; dialog.Flags=0x200|0x80000|0x800|0x4|0x200000 dialog.ShowOpen(); //var ret = dialog.FileTitle; var ret = dialog.FileName; dialog = void 0; return ret; }
In this logon script, we are loading a set of libraries for the WSOffice extension, a set of functions housed in an external script file, and we also have a function that will obtain specific files for uploading. This particular logon script is from an Offline implementation, but you can use logon scripts in any interface.
The logon script is typically named 'elogon.sjs'. This is the same regardless of the target language - if you name the logon script anything other than 'elogon.sjs', the file will not be read.
There is no standard group of elements that will be contained in the logon script file. However, some of the elements that are often contained in the elogon.sjs file are as follows.
'load' commands are used to load external files or libraries for use by the WS engine. Please see the load section for more information.
'onscreen' commands specify a particular screen where an operation will occur. Please see the onscreen section for more information.
'set' commands are used to add a value to a given object in SAP. Please see the set section for more information.
You may also use other commands in logon scripts. However, keep in mind that anything in a logon script will run at logon.