cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion: Header and Item

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Shabarish_Nair
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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