Advanced Looping - Automate_Studio - Latest

Automate Studio with Evolve User Guide

Product type
Software
Portfolio
Integrate
Product family
Automate
Product
Automate > Automate Studio
Version
Latest
Language
English
Product name
Automate Studio
Title
Automate Studio with Evolve User Guide
Copyright
2024
First publish date
2018
Last updated
2024-10-09
Published on
2024-10-09T14:58:14.549846

The way that you record line items depends on the GUI for HTML App.

Multiple-line transactions

Some GUI for HTML App require multiple rows of data to be processed at the same time.

For many of these transactions, SAP separates the data into two parts:

  • A header section: The apps contains data that remains constant for the entire cycle, such as a date.
  • One or more line item or detail sections: Each line item section typically contains reiterative data, which is entered in a grid-like area of the SAP transaction, such as journal entry line items.
    Note: It is good to record two line items of the SAP transaction, so that you can see the repeatable pattern.

After you record the script, including the line items, you create a loop around the line items. Then you set up your data file for the loop.

The value in the Loop ID column tells Studio whether the data in the row is part of the header section or a line of details.

Step-by-step instructions for adding basic loops are in Add a loop in Excel.

Multiple loops

For best results when you use multiple loops to upload data, do the following: While recording, enter more than one line item to create a visible pattern of repetition in the Mapper. After you add the loops, disable the extra item's rows from the Mapper. If you use the same identifier column for different loops, use different identifier values for each loop—for example, D1 for the first loop and D2 for the second loop. You can use the same identifier if the loops refer to different identifier columns.

If the script includes separate sets of line items that are at the same level, you can create multiple loops at the same level in the same sheet. Because some rows will contain information for both loops, you will have a separate loop ID column for each loop, with a different loop identifier value for each loop.

Note: No indentation is needed for loops that are at the same level.

Using loops, conditions, and Else blocks in the Mapper

Copying and cutting rows with loops and conditions; adding Else blocks to If conditions

  • You can cut, copy, and paste rows that contain loops and conditions. To edit a loop or a condition, select all parts of it. You cannot paste a loop or a condition into a log column.
  • You can cut, copy, and paste a complete loop block.
  • You can cut, copy, and paste a complete If block.
  • You can copy and paste just the header row of a loop.
  • You can also copy and paste just the header row of an If condition block.
  • There are pasted header rows of the loop and the If condition block.
  • You can paste the copied rows at the ends of the Mapper rows, and you can insert fields and screens in the last row.
Note: Else blocks can be added to If conditions that are defined inside a loop.

Loop data on multiple sheets

To create a clearer presentation of data when multiple loops are present in a script, you can place the data for different loops on different Excel data sheets.

  • Master sheet: The Excel sheet containing the header data corresponding to the loop applied
  • Loop identifier column: The column on the header sheet that contains the join key
  • Line item sheet: The Excel sheet containing the line item data corresponding to the loop applied
  • Loop identifier column: The column on the line item sheet that contains the join key

You can assign the join key to any column that appears on all of the sheets.

Map multiple-sheet loops

  1. On the Map tab, in the Data Set panel, add as many new sheets as you need.
  2. Click the first sheet. In the Mapper, select the items for the first loop.
  3. Click the Create Loop button.
    Note: Define all loops that are at the same level before you define any nested loops.
  4. For Loop type, click Multiple sheet loop.
  5. Select the appropriate sheets for the header and line items, and specify the corresponding join key columns.
    Note: When a script file is published, the published sheet must contain the same sheet names that are in the script.
  6. Map the fields to their respective Excel worksheets.
  7. If the data source is changed, the preview reverts to Untitled. Either add the sheets manually or open a sheet that contains the appropriate names.
  8. Save the data file preview before you close Studio, or data sheets might be deleted.

Invalid mapping

  • You cannot map a loop to a column that is not part of that loop.
  • You cannot validate when multiple sheets are present.
  • If conditions are validated as sheets are processed.
  • You can use only column-based mapping.
  • Loop can only be applied on the entire entity in the mapper.
  • Loop cannot include partial fields of different entities.