Generic Processing Loop
Component Name and System Landscape
- Name: FCA_SAP_Generic_Loop
- Description: Generic Processing Loop
- Application: FCA_Transactions
- Type: RedwoodScript
Brief Description
This component can be used to execute other (default) components in sequence or in parallel. It is often required to repeat the processing a number of times. In other words, to loop over a list and execute for each value in the list another process.
It will dynamically create child transactions from your specified requirements.
By default, the process of this Generic Loop component (the parent) will wait for all children to complete and adapt its return code (status) of tis children accordingly. In other words, if all children have been processed without issue and therefore have status Completed, the parent will be set to status Completed. In case if one or more children run into Error, the parent will be set to status Error.
Parameter Mapping - Generic Tabs
There are several tabs under this section. Some will be generic, and others are specific to the component. The generic tabs usually are:
- Target: Requires SAP and Client information. You can also hard code the SAP username.
- Infrastructure: Used for Action rules. See the Redwood Finance Automation Reference.
- Recipient parameters: Generally left to default values.
- Job output parameters: Defines the format of the required output. Defaults to RTX and Text. See Porgam Handling for more information.
note
Most of the time these tabs will be shown, but there are components where these differ and either do not appear at all, or they are specific tabs.
Parameter Mapping - Specific Tabs
This guide shows the minimum parameter values required for the component to run. Please refer to the Redwood Automation Engineering Training course for submission and monitoring activities.
Tab | Technical Name | Description | Format | Mandatory Field | Example |
---|---|---|---|---|---|
Target | SAP_SYSTEMS | SAP System If the target process definition contains SAP_SYSTEMS parameter(s), the value specified here will be automatically forwarded. Should contain a valid SAP System as defined in RunMyFinance. Available SAP Systems are listed. | The SAP System, SAP Client and optionally SAP User Name is used to check the amounts format (decimal separator, thousand separator) <PARTITION>:<SAP_SYSTEM_NAME> | REDWOOD:SAP_EC6 | |
Target | CLIENT | SAP Client If the target process definition contains CLIENT parameter(s), the value specified here will be automatically forwarded. Should contain a valid SAP Client as defined in RunMyFinance. Available SAP Clients are listed, based on the chosen SAP System. | The SAP System, SAP Client and optionally SAP User Name is used to check the amounts format (decimal separator, thousand separator) | SAP Client | |
Target | SAP_USER_NAME | SAP User Name If the target process definition contains SAP_USER_NAME parameter(s), the value specified here will be automatically forwarded. | Should contain a valid SAP user. The SAP System, SAP Client and optionally SAP User Name is used to check the amounts format (decimal separator, thousand separator) | ||
Target | LANGUAGE | SAP Language for the Step If the target process definition contains LANGUAGE parameter(s), the value specified here will be automatically forwarded. SAP Language to be used. Which language will be used to generate the SAP reports. | UK (English), DE (German), NL (Dutch) etc. | UK | |
Loop | OUTPUT_PREFIX | Output Name prefix If required, you can specify here the prefix that needs to be put onto the output that is collected from the children onto the parent. | Prefix: Example_loop_ See Table Note (1) | If for example all spoolfiles are collected, you will have the name: Example_loop_step1_spool1.txt | |
Loop | TYPE | Source list type Specify here which type the input source holds. | You can define one of the following values: S (Simple List), M (Multiple Lists), H (Hierarchical List). See the SOURCE_LIST parameter for more details on the values used regarding the chosen type. | Yes | Default is S |
Loop | SOURCE_LIST | Source List for repetition Input of this field is a Merge Record, depending the chosen TYPE. See Table Note (2) | S - Simple List. Merge Record containing one field with one or more values. Format: <value>,<value> M - Multiple Lists. Merge Record containing multiple fields with one or more values. Format: <value>;<value> |<value>;<value> H - Hierarchical List. Format: <value>,<value> |<value>,<value> | If S : 1000,2000,3000 This loop will have 3 iterations where the respective single value is forwarded to the target process. If M : 1000;77777;EUR|2000;66666;USD|3000;55555;EUR. This loop will have 3 iterations where the respective values of three fields are forwarded to the target process. If H: a,b,c|,e,f . This loop will have 9 iterations. It will do iterations based on the values: a and d , a and e , a and f ; b and d , b and e , b and f ; c and d , c and e , c and f . | |
Loop | TARGET_PARAMETER | Target Parameter name(s) Define the parameters of the target process, where the values of the input SOURCE_LIST are forwarded to. Depending on the chosen TYPE and input in SOURCE_LIST it either contains a single target parameter name or multiple parameter names, comma separated. Only parameter names are valid, not the parameter descriptions. | For Simple List S : Always one parameter name. <param_name 1> For Multiple Lists M : Always two or more parameter names, comma separated. <param_name 1>,<param_name 2> For Hierarchical List H : Always two parameter names as only two dimensions are allowed using Hierarchical List. <param_name 1>,<param_name 2> | Yes | For S : <value 1 >,<value 2>,<value 3> for each value listed in SOURCE_LIST a process will be started (the above example will start 3 iterations) where the respective value is put into the specified parameter. For M : <value 1a>,<value 1b> |<value 2a>,<value 2b> for each value pairs listed in SOURCE_LIST a process will be started (this example will start 2 iterations) where the respective values are put into the specified parameters. These parameters need to be specified in the same order as the fields in SOURCE_LIST. For H :<value 1a>,<value 1b>,<value 1c> |<value 2a>,<value 2b>,<value 2c> for each value pairs listed in SOURCE_LIST a process will be started (this example will start 9 iterations) where the respective values are put into the specified parameters. These parameters need to be specified in the same order as the fields in SOURCE_LIST. In this example that would mean that values 1a , 1b and 1c are put into the first specified parameter and that values 2a , 2b and 2c are put into the second parameter. |
Loop | MAPPING_VALUES | Target Mapping values When the target process requires to set more parameters than specified in SOURCE_LIST, you can use this parameter to forward value(s) to specified parameters. | Input is <target parameter name>=<value> . Specify multiple parameters by separating them with a semi-colon; , and 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. PARAM1=abc;PARAM2=X where PARAM1 on the target process will have fixed value abc and PARAM2 on the target process will have fixed value X . To retrieve values from the main process or from steps in the main process, use the parameter MAPPING_FIELDS with ? to mark parameters as optional, like so: ?PARAM1=abc;PARAM2=X. If available in your environment, you can also use Redwood Replacements. | PARAM1=${A:Key1} where the value belonging to Key1 is retrieved from the Application Customizing table. | |
Loop | MAPPING_FIELDS | Target Mapping against fields When the target process requires to set more parameters than specified in SOURCE_LIST, use this parameter to forward value(s) to specified parameters. | Input is: <target / source parameter> , but if the target parameter name is the same as from the source, use: <target parameter name>=<reference to source value> Specify multiple parameters by separating them with a semi-colon ; , and 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. | If source chain parameter is the same as the target parameter: PARAM1. If parameter name differs: PARAM1=PARAMX. If parameter from step differs from target parameter: PARAM1=Step 1, Job 1:PARAMX. Using ? to mark parameters as optional: ?PARAM1 ?PARAM1=PARAMX ?PARAM1=Step 1, Job1:PARAMX | |
Loop | MAPPING_OUT | Out Parameter to retrieve values from This parameter allows you to define that the loop collects output parameters from the child jobs it started. The result will be a Merge Record in output parameter: O_RESULT . | Specify multiple output parameters from the child job, separated by a comma. | OUT_PARAM1,PARAM2 | |
Loop | PARALLEL | Execute in parallel if set. Specify if the child processing is done Sequentially (when left empty), Parallel ( X ), High-volume Parallel (V ) or in Order-based parallel (O ). Sequentially: Each child task is scheduled on Hold and then processing starts by releasing the child tasks one by one. The parent will wait for all child tasks to complete and determines its status accordingly. This option also depends on the BLOCKING and WAIT parameters. Parallel: All child tasks are scheduled to execute immediately. The parent will wait for all childs tasks to complete and determines its status accordingly. High-volume Parallel: All child tasks are scheduled on Hold and are then released in blocks of BLOCKING (Default 50) tasks with WAIT second(s) delays between the blocks. The parent will wait for all child tasks to complete and determines its status accordingly. This option is also depends on parameters BLOCKING and WAIT. Order-based Parallel: All child tasks are scheduled on Hold. Using the parallel order sequence, child tasks with the same order are released. The parent will wait for the released child tasks to complete and will then continue with the next order. The parent will wait for all child tasks to complete and determines its status accordingly. This option depends on parameter PARALLEL_ORDER. | Only (empty, which is default), O , V or X are allowed. | X | |
Loop | BLOCKING | Blocking size Number of tasks to schedule in blocked mode. | This parameter is used in combination with the following options in the PARALLEL parameter: (empty) and V | When for example set to 10 , it will do batches of 10 iterations in parallel. | |
Loop | WAIT | Wait time (seconds) Defines the Wait time in seconds between each batch of iterations. | Number of seconds; default is 1. | 1 | |
Loop | PARALLEL_ORDER | Order of processing Order to which the iteration belongs (separation by comma). Used when parameter PARALLEL is set to O . You can use this parameter to define batches. The time between the batches can be determined using parameter: WAIT. | Comma-separated list | For an Input Loop of 1000,2000,3000,4000,5000,6000,7000 where the Parallel Order is 1,1,1,2,2,3,4 the children are started in the following batches:Batch 1: 1000,2000,3000 Batch 2: 4000,5000 Batch 3: 6000 Batch 4: 7000 For an Input Loop of 1000,2000,3000,4000,5000,6000,7000 where the Parallel Order is 1,1,1,2,2,1,1 the children are started in the following batches: Batch 1: 1000,2000,3000 Batch 2: 4000,5000 Batch 3: 6000, 7000 See Table Note (3). | |
Loop | PRIORITY | Priority Priority of the child tasks. If only one priority is defined, it will be used for all children. You can specify priority for each child task. | Comma-separated list | 50,70,50 | |
Loop | NOWAIT | Do not wait for completion With this parameter set, the parent task will not wait for the completion of the child tasks. 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. | Only empty or X is allowed. | X | |
Loop | CHILD_JD | SubProcess/Transaction Definition to be called as Child Here you can define which transaction definition is to be used to do the processing of one child. | If you specify the name of the definition only or use $.<NAME_OF_DEFINITION> , the definition in the current partition is chosen. You can also specify the partition like: <PARTITION_NAME>.<NAME_OF_DEFINTION> . Alternatively, it can contain a list with the reference specified in the parameter CHILD_JD_MAP. | DefinitionToBeUsed, $.DefinitionToBeUsed, REDWOOD.DefinitionToBeUsed | |
Loop | CHILD_JD_MAP | Child SubProcess and Transaction Definition reference map | |||
Loop | QUEUE | Queue overwrite You can overwrite the queue to be used for all children. | |||
Loop | RC_OK | Map Return codes Allows mapping of the child Return Code. | <source_returncode>=<target_sourcecode> to specify multiple separate them with a comma. | ||
Loop | OUTPUT_REF | Output references to be collected 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 tasks and is semicolon separated. You can use file selection and loop replacement syntaxes. | Format is: <NAME_OF_FILE> or reference to file: <Step x, Job x:NAME_OF_FILE> . Wildcards are permitted. Specify multiple files by using a semi-colon. | Collecting from child definition: Filename.txt . Or using reference to job file of a job in a chain: Step 1, Job 1:filename.txt . Using wildcards: *.txt or * . Step 1, Job 1:*.txt or Step 1, Job 1:** .You can also change the name of the files: newfilename.txt=filename.txt . Or newfilename.txt=Step 1, Job 1:filename.txt . To use in combination with wildcards: newfilename=Step 1, Job 1:*.* newfilename.log=Step 1, Job 1:.*log . The file references are collected in OUTPUT_REF. For example if there are 3 iterations and you collect two files, you can have the following references: 1_filename.txt=JobFile:xxxxx:filename.txt;1_otherfile.log=JobFile:xxxxx:otherfile.log; 2_filename.txt=JobFile:xxxxx:filename.txt;2_otherfile.log=JobFile:xxxxx:otherfile.log; 3_filename.txt=JobFile:xxxxx:filename.txt;3_otherfile.log=JobFile:xxxxx:otherfile.log | |
Infrastructure | TASK_TITLE | Set Job Description If required, you can change the description of the Generic Loop. | Default is: SAP – Generic Loop | By default the job description can read something like: SAP – Generic Loop [Processed 3/3, 0 errors, 0 warnings] , but you can change it to Process FI documents [Processed 3/3, 0 errors, 0 warnings] | |
Infrastructure | PARAMETER_TEMPLATE | Parameter Template to import | <template> Optionally you can add the parameters to import: <template>,param1,param2,etc | ||
Infrastructure | RULE | Action Rule(s) to process | Should contain a valid Action Rule. This Action Rule is processed on the output of the RULE_RESULT parameter after collection of the Rule Results output of the child jobs. | ||
Infrastructure | RULE_RESULT_HEADER | List with Fields used in Resulting RTX | |||
Workflow | ERROR_ACTION | Error Action Specify which action you want to set if the Generic Loop ends up with a status error (if one or multiple child jobs went into error). | C (Continue): If a child job is in error, the next iteration or batch is started until all child tasks are executed. Then the parent (Generic Loop) will get the status Error. E (Exit with Error): This is the default. If a child job is in error, the loop will stop. The parent (Generic Loop) will get the status error. No child tasks after the child in error will be executed. I (Ignore): If a child is in error, the next iteration or batch is started until all child tasks are executed. The parent (Generic Loop) will ignore the children in error and the status will be set to Completed.O (Operator Message): If a child is in error, the parent (Generic Loop) will be set in status console and an Operator Message is sent. The user will need to reply with one of the given options: Error, Continue, or Restart.R (Restart Error Jobs): If a child is in error, it will be restarted x times. The number of restarts is defined in the parameter MAX_RESTART. The default is 3. If the child is still in error after the defined number of restarts, the parent (Generic Loop) will be set to status error. U (User Message): If a child is in error, the parent (Generic Loop) will be set in status console and a User Message or Workflow is sent. This option also requires setting the IN_WF_TO parameter. Other User Message and Workflow parameters are: IN_WF_CC, IN_WF_SUBJECT and IN_WF_TEXT. X : External restart for process in error. Y : External restart for processes in warning or error. See Table Note (4). | Yes | E |
Workflow | RESTART | Restart at Order Defines in which order the process should be restarted. Only valid for Order-based parallel processing. | |||
Workflow | MAX_RESTART | Maximum restarts for error action If ERROR ACTION R is set, you can specify the maximum number of restarts. | Default is 3. | Yes | 3 |
Workflow | IN_WF_DEFINITION | User message definition to be used in Workflow scenario if ERROR ACTION option U is set, you can specify the User Message or Workflow definition. | By default the definition is retrieved from the Application customizing table: ${A:Base_Loop_UserMessage_JD} | ||
Workflow | IN_WF_TO | To users (participants) If ERROR ACTION U is set, you need to specify the user(s) retrieving the User Message or Workflow. | User name | John Doe | |
Workflow | IN_WF_CC | Cc users If ERROR ACTION U is set, you can optionally specify the CC user(s) retrieving the User Message or Workflow. | User name | Jane Doe | |
Workflow | IN_WF_SUBJECT | Subject of workflow If ERROR ACTION U is set, you can specify the subject of the User Message or Workflow. | The default is set to: Transaction ${JobId} '${Job_Description}' failed | Transaction FAGLL03 - G/L Account Line-item Display failed | |
Workflow | IN_WF_TEXT | Text of workflow (Document ID or plain text) If ERROR ACTION U is set, you can specify the text of the User Message or Workflow. | By default it retrieves the text from the Application Customizing table: ${A:SAP_Mail_Workflow} |
Table Notes:
(1) Although spaces are allowed, better not use these as it can lead to difficulties when referencing to these outputs.
(2) Although this parameter is required to start the target process, it is not mandatory as it can happen that the process(es) from which this required input is inherited is not returning any values. If it was mandatory, the process would fail. In this case by default the process will go into status Completed.
(3) It will not collect all equal orders first.
(4) For Sequential processing all options are available. For the others X and Y are only available when WAIT is enabled.
Output Parameters
The Output parameters can be found under the Rule section.
The following output parameters are available:
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. This parameter is automatically populated when the child job have a RULE_RESULT out parameter.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. The above parameters are populated with a Merge Record.
Troubleshooting
Parameters Tab
- Issue:
- Resolution: Possible values for the different input parameters can be set dynamically by using REL expressions or Replacements.
See Also
Redwood Finance Automation Reference
financeTopic