cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion doubt

0 Kudos

Hi everybody!

I have a doubt here in a file content conversion.

I tried to convert a text file to a xml, and I made all the steps to create it.

But, in some cases the conversion occurs in a wrong way.

The file adapter read a text file that has some lines with 240, 400 or 500 positions.

In 240 posistions the conversion is ok. But in lines with 400 and 500 positions the line is broken before the end of the string.

The record set properties are this:

record set structure = Line,1

Line.fieldFixedLengths=999999999

Line.fieldNames=arquivo

ignoreRecordsetName=true

Line.fieldContentFormatting=nothing

has anyone ever experienced this?

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi MArcello,

try

Line.endSeparator = 'nl'

if you want to read line with variable length then  you no need to define
"Line.fieldFixedLengths=999999999"

check following for mor details


http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Answers (7)

Answers (7)

0 Kudos

Hi guys!

I found the problem!!

I was seeing my text file in note pad... and has a 'invisible' broken line...

I copied and paste in a pure text editor and I saw the problem.

Thanks for all !!!

0 Kudos

Hi Iñaki,

I put Line.keepIncompleteFields=yes as you mentioned.

But, my problem persist.

Have you ever manipulated a text file with more than 400 positions?

Thanks,

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

could you paste an example of the file and the expected conversion.

it will be easiest fo us to help you.

regards

0 Kudos

Hi guys,

no one can help me?

I thinking this is a bug. I will open a ticket at SAP.

Thanks,

Marcello

0 Kudos

Hellow again!

I tried your suggestions but didn´t works again.

For exemple, the text file is like this:

01REMESSA01COBRANCA 00000000000000264760******* 290713 MX0000544 000001                       1

.

.

.

And the adapter file convert like the image bellow.

Note that last number 1 is in line, but in convertion, this number appears in another field. Has you can see in image. The end of line is a <ENTER> and don´t have a field separator.

It´s happens when the line has 400 or 500 positions, when the line has 240 positions it´s works fine.

Thanks!

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

try this

record set structure = Line,1

Line.fieldContentFormatting=nothing

Line.fieldFixedLengths=500

Line.fieldNames=arquivo

ignoreRecordsetName=true

Line.additionalLastFields =ignore

Line.missingLastfields = add

let me know.

also if its possible paste an example of your file

rgds

Rodrigo

0 Kudos

Rodrigo,

I tried to do your suggestion, but occured an error at the CC.

My data type:

File content conversion:

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

your configuration is bad.

Line.keepIncompleteFields

update it

0 Kudos

Rodrigo,

I update the properties, but the same error occured.

Have you another suggestion??

Tks,

iaki_vila
Active Contributor
0 Kudos

Hi Marcello,

The parameter Line.keepIncompleteFields should have the value YES:

From help.sap documentation:

NameA.keepIncompleteFields

This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.

  • If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.

This is the default.

  • If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.

Regards.

0 Kudos

Hi guys,

the lines has the same size. But sometimes we have a file with 240 pos, 400 pos or 500 positions.

And the field separator is <ENTER>.

I tried the Line.endSeparator = 'nl', but didn´t works.

Have any suggestions??

Thanks!!

ambrish_mishra
Active Contributor
0 Kudos

Hi Marcello,

For Enter key use '0x0D'

Also try

NameA.keepIncompleteFields  

This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.

○       If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.

This is the default.

○       If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.

You use this parameter to control the behavior of the conversion routine for the last field in a structure.

Use the NameA.missingLastFields parameter to define the behavior at runtime when the structure contains less fields in total that specified in NameA.fieldFixedLengths.

Hope it helps!

Ambrish

iaki_vila
Active Contributor
0 Kudos

Hi Marcello,

Don't you have a field separator?, it's not a good idea to work with fieldfixedlenght and your lines are not  with the same length. Try to use the property keepIncompleteFields = TRUE

Regards.


Former Member
0 Kudos

Hi Marcello

Look like your text file will have multiple lines in it but in content conversion you have specified the occurrence only 1.

Please change the occurrence to *

record set structure = Line,*