cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to File using content conversion

Former Member
0 Kudos

Hi,

Is it possible to mention start and end position in the output file using content conversion or it can be done using message mapping in PI 7.1?

eg:

standard length for first field = 10. and passed value = "NEW_S" , output should be  "NEWS_S     "

standard length for second field = 20. and passed value = "12345678" , output should be "12345678           "

standard length for third field = 5. and passed value = "PC", output should be "PC   "         

Final output as per below screen shot, it should be

(NEWS_S     12345678            PC   )

Please guide.

Thanks & Regards,

Vinoth

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Vinoth,

If you use fieldFixedLengths in the file content conversion you set the exactly length of each field.


Regards.

Former Member
0 Kudos

Thanks Inaki Vila

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vinoth,

As you know source field length and target field length so concatenate the field values with spaces.

for example you says first field length 10 and value coming like "NEW_S", where as the field value coming with 5 length so you can add 5 spaces it would be sufficient for your requirement this is useful only your field always coming with same number of length otherwise it will be failed.

If you don't know the length of source field they please go for field fixed length it would be fulfill your requirement.

Thanks,

Thiru

Former Member
0 Kudos

Hi Thiru,

Thanks for your reply.

Source field length may vary. I will try with field fixed length.

Regards,

Vinoth

Former Member
0 Kudos

Hi Vinoth,

You need to handle this requirement in message mapping that would be easy thing.

Regards,

Former Member
0 Kudos

Thanks for your reply Hanumantha.

I tried using substring function in message mapping, but getting error.

Is there any other functions meet this requirement.

Regards,

Vinoth

Former Member
0 Kudos

HI Vinoth,

While creating your data type, specify the length of the fields and perform content conversion in the file communication channel or else as suggested by Thiru, you can use fieldFixedLengths parameter.