Generic Loop
The FCA_SAP_Generic_Loop definition provides a powerful mechanism to execute other processes in sequence or in parallel using different parameters. In many situations, it is required to repeat the processing a number of times. The processing can be done sequentially or in parallel. To support this processing pattern, this generic process was created. It is also used widely in other content of the Foundation.
It will dynamically create child processes from your specified requirements.
The parent will wait for all children to complete and adapt its return code to the status of its children accordingly. The parent will be set to status Completed when all children have reached status Completed, and to status Error if one or more children reach that status, by default.
Replacements
The loop also has special replacements that can be used for values.
Counter
- is replaced by the current loop indexRun
- is replaced by the current loop value (can be a record)Run(<index>)
- is replaced by the corresponding entry of the record, defined by the index
Generic Parameters
The parameters of this process control how the child is created.
TYPE
- The parameter defines if the processing is using a Simple List (TYPE=S
), Multiple Lists (TYPE=M
) or Hierarchical List (TYPE=H
) values for an iteration. The Simple List allows you to specify a number of comma-separated values, a process is run for each value. The Multiple List allows to define multiple semi-colon separated ( ``; ) values in pipe-separated (|
) sets; a process is run for each set of values. The Hierarchical List allows to define two pipe-separated (|
) lists, a process is run for each combination of values from both lists. For example, if you havea,b,c|d,e,f
you would get 9 runs:a
andd
,a
ande
,a
andf
,b
andd
, ...,c
andf
.SOURCE_LIST
- This parameter contains a list of values that need to be processed. Depending on the TYPE parameter, they are structured as follows:- S:
[<value>[,<value>]*]
- M:
[<values>[|<values>]*]*
- H:
[<value>[,<value>]*]|[<value>[,<value>]*]
- S:
The asterisk ( *
) means you can specify zero or more of these
note
This is an In/Out parameter where the out contains the loop entries that had errors if Restart was set to X
or Y
.
- TARGET_PARAMETER - Here the target parameters are defined. In case of TYPE=S a single target parameter is specified. In case of Type=M a comma separated list of target parameters is used. If no direct target parameter is required (but the information is required indirectly in a concatenation) a target parameter >!< - can be defined.
- CHILD_JD - defines which process is to be used to do the processing of one child. Alternatively it can contain a list with the reference specified in the parameter CHILD_JD_MAP.
- CHILD_JD_MAP - List with process to be used. The parameter CHILD_JD specifies the definition to use.
- PARALLEL - With this parameter one can specify if the child processing is done sequentially (empty), parallel (X), High-volume Parallel (V) or in order based parallel (O).
- Sequential - each child process is scheduled on Hold and then processing starts by releasing the child processes one by one. The parent will wait for all child processes to complete and determines its status accordingly.
- X - Parallel - All child processes are scheduled to execute immediately. The parent will wait for all child processes to complete and determines its status accordingly:
- V - Blocked - High-volume - All child processes are scheduled on Hold and are then released in blocks of
Blocking
(Default 50) processes withWait
second(s) delays between the blocks. The parent will wait for all child processes to complete and determines its status accordingly. - O - Parallel by Order - All child processes are scheduled on Hold. Using the parallel order sequence, child processes with the same order are released. The parent will wait for the released child processes to complete and will then continue with the next order. When all child processes are completed, the parent will determine its status accordingly.
- BLOCKING - Number of processes to schedule in blocked mode.
- WAIT - Defines the Wait time in seconds (Default = 1). It is used for Blocking and (Re)starting processes.
- PARALLEL_ORDER - Order to which the iteration belongs (separation by comma). Used when PARALLEL is set to
O
(upper case letter o) only.
note
If BLOCK=<nr>
is specified, grouping is automatically generated to run the number of processes in parallel.
- PRIORITY - Priority of the child processes. If only one priority is defined, it will be used for all children. It is also possible to specify Order for each child (as a comma separated list).
- NOWAIT - With this parameter set, the parent process will not wait for the completion of the child processes. This parameter is ignored for Sequential and Parallel by Order processing. If the parent does not wait, it also cannot return output parameters and return codes according to child statuses.
- QUEUE - Defines the queue to be used
- RC_OK - Allows for mapping of the child Return Code. The format is
<srcRc>=<trgRc>[,<srcRc>=<trgRc>]
. - MAPPING_VALUES - This parameter allows you to set constants in your target process.
You use the
?
prefix to mark parameters optional; a specified parameter is ignored when not specified on a process definition. Mandatory parameters must be specified on the process definition or the loop will fail.
Syntax: [[?]<target_parameter>=<value>[;[?]<target_parameter>=<value>]]
- MAPPING_FIELDS - Here you can map fields (source->target) with different names.
The Source parameter can also be defined relatively (when used in a process). A direct source parameter is searched up the path of parent processes. You use the
?
prefix to mark parameters optional; a specified parameter is ignored when not specified on a process definition. Mandatory parameters must be specified on the process definition or the loop will fail.
Syntax:[[?]<target_parameter>[=<source_parameter>][;[?]<target_parameter>[=<source_parameter>]]]
- MAPPING_OUT - This parameter allows you to define that the loop collects output parameters from the child jobs it started. The result will be a merged if required. The format is as follows:
[?]<target_parameter>=<child Output parameter>[,<child Output parameter][;[?]<target_parameter>=<child Output parameter>[,<child Output parameter]]
Example: OUT1=O1A,O1B,O1C;OUT2=O2
Resulting in out parameters OUT1 containing a merge record with two fields for each child and OUT2 containing a merge record with one field.
- O_RESULT - Contains the result of all requested mapping output parameters as a merge record.
- RULE_RESULT - Contains a merged list of the rule results from the child jobs
- OUTPUT_REF - Allows the collection of output references which can be used in validations and/or for attaching to mails. The list contains the absolute file references of child processes and is semicolon separated. You can use file selection and loop replacement syntaxes.
Workflow Parameters
ERROR_ACTION - Defines what is to be done if a child returns an error.
E
Exit with ErrorR
Restart Error ProcessesC
ContinueU
Send User MessageX
External Restart for Process in ErrorY
External Restart for Processes in Warning or Error
note
For Sequential processing all options are available. For the others X
and Y
are only available when WAIT is enabled.
- MAX_RESTART - Defines the maximum number of restarts allowed.
- RESTART - Defines at which order the process should be restarted. Only valid for Order based parallel processing.
The following parameters will be used if Error Action U
= User message, is set
IN_WF_DEFINITION
- Defines the User message definition to use, which has a default value pointing it to a new Application Customizing Parameter.IN_WF_TO
- To User (participants)IN_WF_CC
- Cc UserIN_WF_SUBJECT
- Subject of workflowIN_WF_TEXT
- Text of workflow
SAP Specific Parameters
Additionally, the following SAP parameters are automatically forwarded to the client if they exist in the target process.
SAP_SYSTEMS
Target SAP SystemCLIENT
- Target SAP ClientSAP_USER_NAME
SAP User nameLANGUAGE
- Language
note
From these parameters, also the queue is determined dynamically (if not predefined).
financeTopic