Purpose With Include you can include a further script file.
Examples

Further examples
Include "radiobuttons_company.txt"

The file  "radiobuttons_company.txt" is searched in the current script directory. It is then interpreted in the same manner as if its content were part of the original script.

Format Include "includename"

The file  "includename" is searched in the current script directory. If it is not found, a syntax error message is displayed in the GuiXT script window, and the main script is continued. If it is found, first the lines of the include file are interpreted, and then the original script is continued.

You can also specify the full path, e.g.

Include "\\server12\guixt\inlcudes\r105.txt"

Files in the SAP Web Repository or on  http/ftp servers can also be used, e.g.

Include "SAPWR:ZGUIXT.r105.txt"

Include "http://www.synactive.com/includes/r105.txt"

A nested Include is possible up to level 10. Please note that a search is always made in the active script directory, not relatively in the directory where the parent include file is located.

Using variables in include file names When you use variables in include statements, such as in:

   Include "inc.&V[company].txt"

it is important to consider the context of the script:

  • In GuiXT scripts (i.e., outside of InputScripts or functions called by process), the variable value is evaluated at runtime - the exact moment the include statement is processed.
  • In InputScripts and process functions, on the other hand, the include files are read in when the script is loaded. This means that the variable value is not used dynamically, but statically at the time of loading.

 Recommendation: Only use variables in include file names in GuiXT scripts. In InputScripts or process functions, this can lead to unexpected behavior – in such cases, GuiXT issues a warning in the trace. 

Conditional inclusion The conditional inclusion of include files also works reliably in GuiXT scripts. A typical example:

  if Q[Transaction=IW33]
       Include "IW33mainscript.txt"
   
endif
  • In GuiXT scripts, the condition is checked at runtime, and the include file is only loaded if the condition is met.
  • In InputScripts and process functions, the if condition is also evaluated at runtime, but the associated include file is read in independently when the script is loaded.

Recommendation: Use conditional includes preferably in GuiXT scripts to avoid unwanted preloading in InputScripts and process functions.

Components GuiXT