cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion problem

Former Member
0 Kudos

Hi experts.

How would I do a content conversion to get a whole text file into one single field typed string?

Or is the only way to make one field for each line?

Regards

Andreas

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Hi Andreas -

If you have line breaks then i/m not sure if it is possible...

either read the flat file directly and handle it java mapping

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=60653713

or

just read every line and use concat to append them in Graphical mapping..

Former Member
0 Kudos

Trying to read each line using fieldSeparator = 'nl'

Does not work.

How do i get each line?

//Andreas

former_member184720
Active Contributor
0 Kudos

don't use field separator.

just use your <<node>>.endSeparator.. row.endSeparator

Former Member
0 Kudos

Was missing tghe Document namespace.

That solved it with fieldSeparator = 'nl'

former_member184720
Active Contributor
0 Kudos

Refer to the below sample

http://www.riyaz.net/sap/xipi-file-content-conversion-for-simple-structure/75/

you don't need fieldsep as you just have one field

Former Member
0 Kudos

I need either separator or fixedlengths otherwise the content conversion wont work.

//Andreas

former_member184720
Active Contributor
0 Kudos

Yes. as i said just use <node>.endSeparator but not field separator..

Did you check the above link?

Emp.endSeparator : nl

Emp.fieldNames : string1(your xml field)

How did you define the source strcture?

Former Member
0 Kudos

I am not sure whether u are checking answers properly or not?

But did u check the content conversion which Greg has posted in below thread (already shared below)?

Answers (1)

Answers (1)

javier_alcubilla
Contributor
0 Kudos

Check this blog

Hope it helps

Regards

Javi

Former Member
0 Kudos

Well that was how to put an XML into one field in a mapping.

I want the text file unconverted into one single field.

//Andreas

javier_alcubilla
Contributor
former_member184720
Active Contributor
0 Kudos

which was already suggested..

Former Member
0 Kudos

Thanks for the input.

See comments at the bottom of thta blog.

I would like to achive it with FCC not a java mapping.

//Andreas

Former Member
0 Kudos

Hello,

I think u an still use FCC, and read each line in a single record and then in the mapping using concat function just add everything into a single line - obviously by this way u can avoid JM.

Thanks

Amit Srivastava

former_member184720
Active Contributor
0 Kudos

Did you try the other approach ? reading each line and concating in mapping?

javier_alcubilla
Contributor
0 Kudos

Last try. Could you provide an example?

Former Member
0 Kudos

Hello,

Check Greg's reply

Thanks

Amit Srivastava

Former Member
0 Kudos

Solved with a concat in an UDF format.

Adding 'nl' after each field.

Regards

Andreas