Pre/Post Script
This topic describes how to configure the Pre Script or Post Script options to run an internal script or external file before running the Process file. You can configure both the pre-run and post-run settings at the same time. The external file can be a standard executable file, batch file, a VBScript, JavaScript, or Visual Basic file.
To configure pre-run or post-run script options
- Open the Process file for which you want to include the pre-run or post-run script, select Edit tab, and then one of the following options:
- Pre Script: Indicates that the script is run before the Process file run.
- Post Script: Indicates that the script is run after the Process file run.
- Select Pre Script or Post Script. The Pre-Run/Post-Run Process Settings window is displayed. Perform the following steps:
- On the Pre-Run iScript tab, select Pre-Run Process or on the Post-Run iScript tab, select Post-Run Process and select one of the following options from the dropdown list:
- Internal Script: Allows you to enter a script written in VBScript, JavaScript, or VB.Net in the Internal Script editor box. Optionally, select Insert Sample Code to use one of the sample scripts provided.
Note: For VB.Net, you can also select from the predefined libraries depending on your requirement. For example, select Innowera Easy Workflow Library to download an EShare file or start a workflow using the Download EShare File or Start Workflow functions. This library is not supported when EShare is configured using the EShare Service URL.
- External File: Allows you to select an external
.exe
,.bat
,.vbs
, or.js
file that is on your computer. Optionally, right-click in the parameters text box to view the list of predefined parameters that you can use in the selected external file and ensure that you separate each parameter with a comma.
Predefined parametersVariable name
Description
#CURPRTYPE#
Displays the type of the current Process file.
TX
for TransactionBA
for BAPI/RFMGS
for GUI ScriptingDE
for Data Extractor
#CURPROC#
Displays the name of the process, table, or BAPI used in the current Process file.
Example:
MM02
,MARC
,BAPI_CREATE_CONTRACT
#CURPRFILE#
Displays the full path of the current Process file.
Example:
C:\Innowera\MRRC.ite
#CURXLFILE#
Displays the full path of the current Excel file.
Example:
C:\Innowera\test.xls
#CURXLSHEET#
Displays the name of the current worksheet.
#CURSAPSYS#
Displays the name of the SAP system used to run the current Process file.
Example:
PR1
,DEV
,QAS
#SAPUSR#
Displays the SAP user name used to log onto the SAP system.
Example: JSMITH
#SAPLAN#
Displays the language of the interface of the SAP system.
Example: EN, FR, DE
#SAPCLIENT#
Displays the client number used to log onto the SAP system.
Example: 101, 800
#SAPSYSTEMNO#
Displays the system number used of the SAP system.
Example: 00, 01
#NOOFREC#
Displays the number of records extracted from SAP. This option is available only for Data Extractor.
#NOOFCALL#
Number of finished calls after a process completed. This option is available only for Transaction.
#RUNTYPE#
Displays the run type.
1
for Run2
for Test Run3
for Error Processing Run-
4
for Debug Run
#ERRORCOUNT#
Displays the number of errors. This option is available only for Transaction.
#ERRORSTAT#
Displays the status of the current task;
1
if an error occurs and0
if the task is run successfully.#ERRORMSG#
Displays the error message if the
#ERRORSTAT#
returns 1.Example:
Specify account number.
SAP Front end Server: The method got an invalid argument.
#XLDATASTARTROW#
Displays the Excel row number from where the run starts.
#XLDATAENDROW#
Displays the Excel row number where the run ends.
#XLDATASTATCOL#
Displays the statistics column.
#XLDATALOGCOL#
Displays the log column.
#ISMASTERPROCESS#
Displays whether the Process file is master file;
1
if it is the master process and0
if it is not.#MASTERXLFILE#
Displays the name of the Excel file used in the master Process file.
#MASTERXLSHEET#
Displays the name of the worksheet used in the master Process file.
#MASTERXLDATASTARTROW#
Displays the Excel row number in the master Process file from where the run starts.
#MASTERXLDATAENDROW#
Displays the Excel row number in the master Process file where the run ends.
- Internal Script: Allows you to enter a script written in VBScript, JavaScript, or VB.Net in the Internal Script editor box. Optionally, select Insert Sample Code to use one of the sample scripts provided.
- In the Process Settings section, select the following options that determine what must be done when an external file is busy or closed:
- Wait options:
- 1-No Wait: Indicates that the Process file does not wait for external file if the file is busy or closed.
- 2-Wait until terminated: Indicates that the Process will waits until the external file gets terminated.
- 3-Wait until second: Indicates that the Process file waits for specified seconds.
- Stop on error: Indicates that the Process file stops if the external file or internal script throws an error.
- Run with normal Run: Indicates that the external file or internal script runs only when you perform a normal run. This option is displayed only for Transaction, BAPI/RFM, and GUI Scripting Process files.
- Run with Test Run: Indicates that the external file or internal script runs only when you perform a test run. This option is displayed only for Transaction Process file.
- Run with Debug: Indicates that the external file or internal script runs only when you perform a debug run. This option is displayed only for Transaction and GUI Scripting Process files.
- Run with Error Processing: Indicates that the external file or internal script runs only when you perform an error processing run. This option is valid displayed for Transaction and BAPI/RFM Process files.
- Select OK. The updates are saved.
- On the Pre-Run iScript tab, select Pre-Run Process or on the Post-Run iScript tab, select Post-Run Process and select one of the following options from the dropdown list:
- To add a third-party library file that can be used in the custom VB.NET script in the Pre-Run iScript, Post-Run iScript, and Custom Process script editor, select Custom Library > Add. The Add Custom Library window is displayed. Perform the following steps
- Select Add. The Add Custom Library window is displayed.
- In the Library file box, browse to the location on your computer where the library file exists. Process Runner supports only 32-bit library file.
- By default, the name of the file selected in the Library file box is displayed in Library name box. Optionally, you can edit the name.
- In the Runtime path for library section, select one of the following options:
- Reference Path: Indicates the path on your computer where the library file exists, which will be used to run the custom script.
- Environment Variable: Indicates the variable name that you select from the dropdown list . The variable name is associated with the path in which the library file is placed. Select this option to share the Process file with other users, typically run-only users. To use this Process file, the run-only user must create an environment variable in the System Properties > Advanced tab > Environment Variables with the same name displayed here, and configure the path where the custom library file exists, after adding the library file.
- Select Pre-Run iScript, Post-Run iScript, and Custom Process depending on where you want to use the library file.
- Select OK. The library file with the configured details is displayed in the custom library grid.