Skip to Content
author's profile photo Former Member
Former Member

File Content Conversion

basically I like to treat entire record as one field with structure as follows:

Rec1

Rec2

Rec3

I need convert this into XML as follows

<File>

<Record>Rec1</Record>

<Record>Rec2</Record>

<Record>Rec3</Record>

</File>

To do this I would like to what values I need to give for fieldseparator( 'nl' ???) and endseparator( this is end of file )

Please note I have only One field which is <Record> with 0 to unbounded

I did some testing with following values

RecordStructure = Source,1

Source.fieldSerparator = 'nl'

Source.fieldNames = Record

Its producing like this Which is not I wanted.

<File>

<Record>Rec1</Record>

</File>

<File>

<Record>Rec2</Record>

</File>

<File>

<Record>Rec3</Record>

</File>

I would like to produce

<File>

<Record>Rec1</Record>

<Record>Rec2</Record>

<Record>Rec3</Record>

</File>

Inorder to do this I should be able to distinguish between newline and endoffile conditions.

newline is 'nl'

and what is end of file ?

Also what ever parameters I gave , are they correct?

Would someone please explain. Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 12:36 AM

    Hi Ram

    I think you dont need to use fieldseparator when your record has only one field, can you try using this -->

    RecordStructure = Source,1

    Source.fieldNames = Record

    Source.endSeparator = 'nl'

    Pls. dont use

    Source.fieldSerparator = 'nl'

    Let me know.

    - Lalit -

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      yes I did. no Use.. it still produces same .

      http://test.com">

      - <Source>

      <Record>first line</Record>

      </Source>

      - <Source>

      <Record>this 2nd line</Record>

      </Source>

      - <Source>

      <Record>Last Line</Record>

      </Source>

      </ns:Source>

      Message was edited by: Ram Krish

  • Posted on Sep 28, 2006 at 01:17 AM

    Hi,

    You can try with ignoreRecordset and check this ..Probably it works.

    Otherwise, you can think with normal content conversion i.e with key values.

    Have a look into this content conversion -

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

    Regards,

    Moorthy

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.