cancel
Showing results for 
Search instead for 
Did you mean: 

Flat File problem

Former Member
0 Kudos

i have the Flat File format example as below:

Leo

456~123

string1+string2

Nick

478~124

string3+string4

and the target xml should be:

<person>

<name>Leo</name>

<ID>

<SocialID>456</SocialID>

<EmployeeID>123</EmployeeID>

</ID>

<Description>

<JobTitle>String1</JobTitle>

<Address>String2</Address>

</Description>

</person>

<person>

<name>Nick</name>

<ID>

<SocialID>478</SocialID>

<EmployeeID>124</EmployeeID>

</ID>

<Description>

<JobTitle>String3</JobTitle>

<Address>String4</Address>

</Description>

</person>

I have chosen the File Content Conversion File Adapter

but how to set the fieldSeparactor

Thank you for your advice

Accepted Solutions (0)

Answers (6)

Answers (6)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

the strcuture that you are trying to achieve will not be possible using the standrad file adapters content conversion!

The File adapters content conversion can be used to create a strcuture like,

<root>
<record>
   <element1> 
         <xx1> </xx1>
         <xx2> </xx2>
   </element1>
   <element2>
       <yy1> </yy1>
      <yy2> </yy2>
   </element2>  
</record>
</root>

Try pushing the name into the <ID> and this can be achieved.Also, you would need to change the source file as follows,

<b>Leo,456,123,string1,string2

Nick,478,124,string3string4</b>

The content Conversion parameters on sender file adapter will then look as follows,

DocumentName : give the message type name
DocumentNamespace : give the namepace
RecordsetName : PERSON
RecordsetStrucutre : ID,1,DESCRIPTION,1

The Table will contain entruies,

ID.fieldNames : NAME, SOCIALID, EMPLOYEEID
ID.fieldSeparator : ,
ID.endSeparator : 'nl'
DESCRIPTION:fieldNames: JOBTITLE,ADDRESS
DESCRIPTION.fieldSeparator : ,
DESCRIPTION.endSeparator: 'nl'

<person>
<ID>
<name>Leo</name>
<SocialID>456</SocialID>
<EmployeeID>123</EmployeeID>
</ID>
<Description>
<JobTitle>String1</JobTitle>
<Address>String2</Address>
</Description>
</person>
<person>
<ID>
<name>Nick</name>
<SocialID>478</SocialID>
<EmployeeID>124</EmployeeID>
</ID>
<Description>
<JobTitle>String3</JobTitle>
<Address>String4</Address>
</Description>
</person>

Regards,

Bhavesh

Former Member
0 Kudos

There is a content conversion module for XI, where you can specify the parameters for converting from a flat file to a XML structure.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bf...

That PDF helped me a lot when I was first doing it

Former Member
0 Kudos

Leo,

Check this weblog which will help you:

/people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi

---Satish

RKothari
Contributor
0 Kudos

Hi,

Below link will provide you more help......

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

Regards,

Rahul

Former Member
0 Kudos

Hi Leo,

See this..

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

cheers,

Prashanth

P.S Please mark helpful answers

Former Member
0 Kudos

Hi ,

you may try field separator as 'nl'

i hope it may work..

Ramesh