Purpose: Split a text field into multiple rows. Each part of the text becomes a separate row, and the other fields of the source row are repeated for every part.
For example, a source row with MATNR = 100 and PLANTS = 1000;2000;3000 becomes three rows: 100 / 1000, 100 / 2000, and 100 / 3000.
You find the plugin in the Non-SAP Targets group of the designer. It is a converter: map a source to its import columns and map its export columns to a target. It doesn't connect to SAP: the split runs locally in VeloXm.
How to use
- Add the Split To Array plugin to the canvas.
- Open Settings and select the split type. See Settings.
- In Columns, enter a column name and click Add Column. Repeat for each column you need.
- Select Array Field before you click Add Column to mark the column that holds the text to split.
- Map the import columns to your source.
- Map the export columns to a target.
Each column you add has an import side and an export side. Column names must be unique in the plugin: if you add a name that already exists, no new column is added. To remove a column, click the close button on the column.
Settings
| Setting | Description |
|---|---|
| Split by separator | Splits the text at the separator. Enter the separator in Separator:. The default is ;. This is the default split type. |
| Split by length | Splits the text into parts of a fixed number of characters. Enter the number in Length: (minimum 1). The last part can be shorter. |
Select the split type in the list at the top of Settings.
When you use Split by length, always enter a value in Length:. If the length is left at 0, the run stops with an error.
If you enter more than one character in Separator:, the text is split at each of these characters, not at the full string. For example, ;, splits at both ; and ,.
Column options
Click a column to change its options:
- IsArray marks the column whose value is split. The A flag appears on the column. Use one array column per plugin. If several columns are marked, only the first one is split.
- IsRowIndex marks a column as a row index column. The I flag appears on the column.
Run-time behavior
- The array column must be mapped. If it is not, the run stops with an error.
- The plugin reads all rows from the source that is mapped to the array column.
- For each source row, the array column value is split into parts. Every other column mapped from the same source is repeated for each part.
- Columns mapped from a different source get a single value. That value appears in the first output row only.
- If no column is marked as IsArray, the plugin returns no rows.
- With Split by separator, empty parts are kept. For example,
A;;Bgives three rows, the second with an empty value, and an empty source value gives one row with an empty value. If Separator: is empty, the text is split at white-space characters. - With Split by length, a source row with an empty array value gives no output rows.
- When the next plugin reads the result as a table, rows that have the same values in all requested columns are returned once.
- The plugin works the same way in simulation mode, because it doesn't write data anywhere.
- The output table is written to the technical log, with the plugin version. If the run fails, the log row is marked as an error with the exception text.
In the current version, the IsRowIndex column does not number the rows: it is filled with 0, and only for as many rows as the last source row produced. Don't map a source to a row index column. If you need a position number, calculate it in a following plugin.