Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Current »

USE:

int4 IFTT uses XPath expressions to extract specific values from xml files. For fetching values from flat file messages int4 IFTT uses our simple language created specifically for this purpose. 

PROCEDURE:

Following tags can be used in flat file expressions:

  • CSV_COLUMN - in CSV file column number for further extraction 
  • CSV_SEPARATOR - optional separation character different than comma
  • CSV_SKIP_HEADER - skips first row in the CSV file
  • START_TAG - determine string, as the starting point 
  • START_FROM - determine from which character after string defined in START_TAG derivation should start. First character is 1 
  • LENGTH - determine length of string, that will be saved
  • END_TAG - determine string, as the ending point
  • REGEX - match specific part of the file using regular expression. 
    By default whole regular expression is matched and used for variable replacement. It is possible to use subgroups to extract/replace part of the expression. If there is a subgroup defined it is used instead of the whole result. See example 5 below.
    More information about regular expressions syntax in ABAP: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenregular_expressions.htm


Each tag should be separated by &&

START_TAG or START_FROM are obligatory tags (unless REGEX is used)


Example 1: In order to derive string IFTT001 from the example flat file below, the following expression could be used : START_TAG(BGM+220+)&&START_FROM(1)&&LENGTH(7)

This expression can be used for extracting values with no ending tag, or to extract only a part of the value. 


UNA:+.? '
UNB+UNOA:3+000000000B:ZZ+0000000ECC:ZZ+20051107:1159+6002'
UNH+000000101+ORDERS:D:96A:UN:EAN008'
BGM+220+IFTT001+9'


Example 2: In order to derive string IFTT002 from the example flat file below, the following expression could be usedSTART_TAG(BGM+220+)&&END_TAG(+)

In this case the expression will work independently of the values length.

UNA:+.? '
UNB+UNOA:3+000000000B:ZZ+0000000ECC:ZZ+20051107:1159+6002'
UNH+000000101+ORDERS:D:96A:UN:EAN008'
BGM+220+IFTT002+9'


Example 3: In order to derive string IFTT003 from the example flat file below, the following expression could be used : START_FROM(9)&&LENGTH(7)

This expression can be used for extracting values with no starting and ending tags, or to extract only a part of the value. This statement is especially useful for handling very long strings.

UNA:+.? '
UNB+UNOA:3+000000000B:ZZ+0000000ECC:ZZ+20051107:1159+6002'
UNH+000000101+ORDERS:D:96A:UN:EAN008'
BGM+220+IFTT003+9'


Example 4: In order to derive string IFTT004 from the example flat file below, the following expression could be usedSTART_FROM(9)&&END_TAG(+9)

In this case the expression will work independently of the values length just starting from a specify point till the end tag.

UNA:+.? '
UNB+UNOA:3+000000000B:ZZ+0000000ECC:ZZ+20051107:1159+6002'
UNH+000000101+ORDERS:D:96A:UN:EAN008'
BGM+220+IFTT004+9'


Example 5: In order to derive string IFTT004 from the example flat file below, the following expression could be usedREGEX(BGM\+220\+([A-Z0-9]+)\+9)

UNA:+.? '
UNB+UNOA:3+000000000B:ZZ+0000000ECC:ZZ+20051107:1159+6002'
UNH+000000101+ORDERS:D:96A:UN:EAN008'
BGM+220+IFTT004+9'

Expression used in this example uses subgroup to extract part of the matched string . Subgroups are defined using  ( ... ) operator. REGEX(BGM\+220\+([A-Z0-9]+)\+9)
Expression REGEX(BGM\+220\+[A-Z0-9]+\+9) without subgroup matches entire line: BGM+220+IFTT004+9'


Please note that LENGTH tag works only combined with START_FROM.

It is possible to use multiple expressions for single variable processor and join them with || operator. All matching values are collected and saved to the same variable then.

  • No labels