The below description is from the technical manual.The definition of the variable remains the same (custom function/script/any DS object)
Overview of variables and parameters
You can increase the flexibility and reusability of work flows and data flows by using local and global variables when you design your jobs. Variables are symbolic placeholders for values. The data type of a variable can be any supported by the software such as an integer, decimal, date, or text string.
You can use variables in expressions to facilitate decision-making or data manipulation (using arithmetic or character substitution). For example, a variable can be used in a LOOP or IF statement to check a variable's value to decide which step to perform:
If $amount_owed> 0 print('$invoice.doc');
If you define variables in a job or work flow, the software typically uses them in a script, catch, or conditional process.
You can use variables inside data flows. For example, use them in a custom function or in the WHERE clause of a query transform.
In the software, local variables are restricted to the object in which they are created (job or work flow). You must use parameters to pass local variables to child objects (work flows and data flows).
Global variables are restricted to the job in which they are created; however, they do not require parameters to be passed to work flows and data flows.
Note: If you have workflows that are running in parallel, the global variables are not assigned.
Parameters are expressions that pass to a work flow or data flow when they are called in a job.
You create local variables, parameters, and global variables using the Variables and Parameters window in the Designer.
You can set values for local or global variables in script objects. You can also set global variable values using external job, execution, or schedule properties.
Using global variables provides you with maximum flexibility. For example, during production you can change values for default global variables at runtime from a job's schedule or “SOAP” call without having to open a job in the Designer.
Variables can be used as file names for:
- Flat file sources and targets
- XML file sources and targets
- XML message targets (executed in the Designer in test mode)
- IDoc file sources and targets (in an SAP application environment)
- IDoc message sources and targets (SAP application environment)