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

Content Conversion: Header and Item

Hi everybody,

as the parameters are not explained detailed, I have to ask you:

I have a file as follws:

SENDER;RECEIVER //this line occurs only once

1111;2222 //this line occurs only once

ARTICELNUMBER;AMOUNT//this line occurs only once

444;10//this line occurs unbounded

555;20

..;

The result should look like this (line 1 and 3 have to be ignored!)

<ORDER>

* <HEAD>*

* <SENDER>1111</SENDER>*

* <RECEIVER>2222</RECEIVER>*

* </HEAD>*

* <ITEM>*

* <ARTICELNUMBER>444</ARTICELNUMBER>*

* <AMOUNT>10</AMOUNT>*

* </ITEM>*

* <ITEM>*

* <ARTICELNUMBER>555</ARTICELNUMBER>*

* <AMOUNT>20</AMOUNT>*

* </ITEM>*

</ORDER>

What parameters and which values do I need?

Thanks a lot,

Regards Mario

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 07:42 AM

    Hi all,

    thank you for your replies.

    Please confirm my assumtion:

    If I have different Structure (in my sample HEADER & LINE) I MUST define keyFields and each row in the csv-file must itselft identify.

    Regards Mario

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Mario,

      >If I have different Structure (in my sample HEADER & LINE) I MUST define keyFields and each row in the csv-file must itselft identify.

      I would like to say the above in a different way.

      If we have different structure and the occurence of each structure is not fixed i.e HEADER may appear 1 or 2 or N times and LINE may appear N number of times. Then we use KeyField.

      Now suppose there could be cases when we have different structure but the number of times a structure appears is fixed.

      Say HEADER 1 time and LINE 10 times. In this case we dont need to use keyFields.

      Regards,

      Sumit

  • Posted on Jan 04, 2008 at 03:29 PM

    you can ignore lines N lines starting from the first line using the offset option. ie you can for example ignore line 1 to line 3 but not line 1 then skip line 2 and then ignore line 3.

    My suggestion is,

    skip line 1 using the offset option.

    After that using the normal content conversion read all the other lines. once you get the xml, dont use any kind of mapping logic on your 3rd line. So everything works normal.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Shabarish ,

      thanks for your reply.

      Skipping several lines is not the primary problem.

      My first problem is, to split a file into HEAD an ITEM.

      I do not know, who to specify the parameters.

      Regards Mario

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 04:27 PM

    Hi,

    Check some links on FCC,hope they may help u out.

    File content conversion sites

    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

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

    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

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

    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns

    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

    Regards,

    phani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 08:13 PM

    Read whole lines into a custom datatype and use Java mapping to get the desired output.

    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.