Content conversion in Sender file adapter-- 2 new useful parameters

Content conversion in Sender file adapter-- 2 new useful parameters

When we use the sender file adapter to do a content conversion, the conversion routine assumes that all structures are constant. The number of fields corresponds to the entry in parameter NameA.fieldNames or the number and length of fields in parameter NameA.fieldFixedLengths .

Quite often though, the structure of the incoming file is different and this causes the conversion routine to raise an error.

To allow the structure at runtime to be different than the configured structure, configure NameA.missingLastFields and NameA.additionalLastFields parameters.

If these two parameters are not used, then the result of the conversion depends on whether you have configured the NameA.fieldFixedLengths parameter. This parameter has been available for quite some time, so will not be discussed here.

Now lets look the configurable values for parameter:
NameA.missingLastfields

If the inbound structure has less fields than specified in the configuration then the XML outbound structure is created as follows:

ignore: Outbound structure only contains the fields in the inbound structure
add Outbound structure contains all fields from the configuration; the fields missing in the inbound structure are empty.
error: Conversion is terminated due to the incomplete inbound structure. An error message is displayed.

NameA.additionalLastFields

If the inbound structure has more fields than specified in the configuration then the XML outbound structure is created as follows:

ignore: Outbound structure only contains the fields in the inbound structure
error: Conversion is terminated due to the incomplete inbound structure. An error message is displayed.

The default value is ignore. If you have defined the NameA.fieldFixedLengths parameter, the default value is error.

Lets take a simple example to illustrate the use of NameA.additionalLastFields parameter.
Lets take a simple structure conversion of a file, defined in the ID as:
image

The source file for this looks like:
header;20040219;NB;3000;R30;0000010400;
item;00010;1500-510;3000;20040504;1;
This would process correctly.

If the incoming file looks like
header;20040219;NB;3000;R30;0000010400;**;
item;00010;1500-510;3000;20040504;1;**;
This file would cause an error.
image

Lets change the configuration in the ID & include the parameter for additionalLastFields with value ignore.
image
The message gets processed correctly and is seen in the monitor.
image

The last additional fields are ignored.

SAP PI TRAINING

SAP Developer Network SAP Weblogs: SAP Process Integration (PI)