load

Loads an external file.

The load command is used to load an external file. Once this file is loaded, anything included in the file will be available for global use in WS scripts. Currently only the following file types are supported:

The syntax is as follows:

load("filename");
		load('filename');

You can load files from any of the following locations:

Local directories

To load a file from a directory on your local machine, the syntax would be:

load("filename");
Note: If the file is not in the same directory as the script file, you must specify the full path.
Network shares

To load a file from a shared directory on the network, use the following syntax:

load("\\\\company.com\\directory\\filename");
SAP Web Repositories

To load a file from the SAP Web Repository (SAPWR), use the following syntax:

load("SAPWR:Z.GUIXT.SAPLSMTR_NAVIGATION.0100.sjs");
Note: Use the file command to give the file an alias if it exceeds the 30-character limitation on SAPWR file names.

Options

The load command does not take any options:

Example

To demonstrate the load command, please do the following:

Note: You must have wsoffice.dll installed for this test to succeed.
  1. Open a script file and add the following code.

    load("wsoffice.dll");
  2. Perform an action in SAP that requires wsoffice.

  3. Verify that your test completes successfully. if so, then the load command correctly loaded the wsoffice.sjs file.