cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File Adapter. Fixed Lengths and Field Separator

Former Member
0 Kudos

Hello guys,

I have a doubt in Sender File Adapter with Content Conversion.

I have a text file like:

a,b,c,,e

I have the configuration in the adapter:

Register.fieldNames: a,b,c,d,e

Register.fieldSeparator: ,

The question I have is can I format the length of the text when i create the XML?

I woul like to create the XML like:

<Row>

<Register>

<a>a </a>

<a>b </a>

<a>c </a>

<a> </a>

<a>e </a>

</Register>

</Row>

I would like that when I create the file in Field A I have length = 4, but I have only 1 in the entry, and I want to fill the rest of the length with spaces.

I tried with FieldFixedLengths but when I test it the fields are not being formatted and take the commas as part of the field.

I know that this can be done in Receiver File Adapter, you leave for example one field of 5 length and you format it to 12 length with spaces.

Is this possible for Sender File ADapter?

Many thanks.

Regards,

Xavi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

See the example given in this bog, in this blog the string has been splited into different fields as per the field length, so you may use the same concept to get your output.

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

I hope it helps you.

Regards,

Sarvesh

Answers (3)

Answers (3)

Former Member
0 Kudos

This is not what I need, the weblog is for the order of the structure.

I am asking if is possible to format the input fields to some length.

Many thanks.

Xavi.

Former Member
0 Kudos

I think you can achieve the same by using the java mapping.

Have a look..

/people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi

Also to get the space as it is from your source file use the below parameter in FCC

NameA.fieldContentFormatting = nothing

Former Member
0 Kudos

Hello Sarvesh,

I want to format the file in the adapter, I would like to avoid to format in the mapping.

Anybody knows how to do this?

Regards,

Xavi.

Former Member
0 Kudos

I know it is possible in Receiver adapter, but there is no possibility to format the fields I take of the flat file to some length in Sender File Adapter?

Regards,

Xavi.

Former Member
0 Kudos

you use either fixed length or field separator, you can not use both of them in the same CC, even in receiver adapter.