cancel
Showing results for 
Search instead for 
Did you mean: 

File recevier content conversion - 2 header lines

Former Member
0 Kudos

Hi all,

I have a receiver setup to append a csv file on ftp server with new data. The problem is that customer asked me to have 2 header lines on top of that file. According to receiver conversion parameters I can setup a headerLine parameter for my adapter, but only with one line. Is there any workaround for this solution? I cant put this header lines in mapping because I am appending or at least I do not know how to setup receiver adapter to get it done. Any ideas?

br

Dawid

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

See the below from help

NameA.addHeaderLine :

Specify whether the text file will have a header line with column names. The following values are permitted:

· 0 – No header line

· 1 – Header line with column names from the XML document

· 2 – As for 1, followed by a blank line

· 3 – Header line is stored as NameA.headerLine in the configuration and is applied

· 4 – As for 3, followed by a blank line

This specification is only permitted if exactly one structure is defined

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

Regards

Chilla

Former Member
0 Kudos

Hi Chandra,

What I would like to achieve:

header line 1

header line 2

csv row 1

csv row 2

...

the problem is that I am getting this setup:

header line 1

header line 2

csv row 1

header line 1

header line 2

csv row 2

how can I get this fixed.

here is my receiver setup:

fileConstructionMode = append

record.addHeaderLine = 3

record.headerLine = "header line 1"

record.beginSeparator = "header line 2"

Former Member
0 Kudos

hey

just remove record.addHeaderLine = 3

but make sure that record is ur main structure.ur getting different output coz the beginSeparator and headerLine are workin on substructures too.

can u paste a small copy of ur actual XML so that we can help u a bit more

thanx

ahmad

Former Member
0 Kudos

Hey

it looks like the occurence of ur record tag is 0-unbounded and thats why ur getting this different output.

am i correct?

thanx

ahmad

Message was edited by:

Ahmad

Former Member
0 Kudos

Hi,

Try the below

record.headerLine = "header line 1"

record.addHeaderLine = 3

record.addHeaderLine = 4

But the record.addHeaderLine = 3 is necessary , because whatever we add to the addheaderLine , will be repeated

see the above link

Regards

Chilla

Former Member
0 Kudos

Hey Chilla

ur correct but i think the record tag is not the main structure instead its a substructure whose occurence is more than 1,thats why he is getting a different output

what do u think?

thanx

ahmad

Message was edited by:

Ahmad

Former Member
0 Kudos

Here is XML for that message:


<?xml version="1.0" encoding="utf-8" ?>
<ns2:MaterialMsg xmlns:ns2="http://Workmanager/WorkmanagerPDM">
<record>
    <Codice>&quot;11020693&quot;</Codice>
    <Versione>&quot;1&quot;</Versione>
    <Revisione>&quot;-&quot;</Revisione>
    <Revlv>&quot;-&quot;</Revlv>
    <Descizione>&quot;SPRING 4.2X13X0.5X9.5&quot;</Descizione>
    <Nome_classe>&quot;C_PARTICOLARI&quot;</Nome_classe>
    <GenItemCatGrou>&quot;ZERL&quot;</GenItemCatGrou>
  </record>
</ns2:MaterialMsg>

By main structure u mean MaterialMsg or record?

br

Dawid

Former Member
0 Kudos

Hey

just change ur message structure to the following

<?xml version="1.0" encoding="utf-8" ?>

<ns2:MaterialMsg xmlns:ns2="http://Workmanager/WorkmanagerPDM">

<Recordset>

<record>

<Codice>"11020693"</Codice>

<Versione>"1"</Versione>

<Revisione>"-"</Revisione>

<Revlv>"-"</Revlv>

<Descizione>"SPRING 4.2X13X0.5X9.5"</Descizione>

<Nome_classe>"C_PARTICOLARI"</Nome_classe>

<GenItemCatGrou>"ZERL"</GenItemCatGrou>

</record>

</Recordset>

</ns2:MaterialMsg>

Note:Occurence of <Recordset> is 1-1

and give the same parameters using <Recordset> instead of <record>.

see if i m not wrong the occurence of <record> is 0-unbounded or 1-unbounded.

so it will disply the header each time for every new record.

when u encapsulate the <record> under <Recordset>,then occurence of <Recordset> will be 1-1 and it will be displayed only once

thanx

ahmad

Answers (2)

Answers (2)

Former Member
0 Kudos

I have used different approach, as none of proposed were 100% solutions.

br

Dawid

Former Member
0 Kudos

Hi Dawid,

I am facing the same problem u2013 when using append mode the adapter write the header line again (I only have one header line ).

You wrote that you solved the problem using different approach.

Can you please explain your solution?

Thanks,

Tomer

Former Member
0 Kudos

Hey

u can insert the second line by using the .beginSeparator

for e.g.

recordset.beginSeparator = Second Header Line

but use this one only for the main structure

thanx

ahmad