cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion : File to File Scenario

Former Member
0 Kudos

hi all,

I have a Input file

It has the following structure:

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

<n0:rfc_proxy_message_type xmlns:n0="http://kpr.com/sample">

<Name>abhishek</Name>

<Age>10</Age>

</n0:rfc_proxy_message_type>

I use a File to File Scenario, with Sender and receiver FTP adapters.

I would like to convert this file at the recieveing end into a flat file as follows:

Name Age

abhishek 10

How can I do so?

Can anyone please help.

Thanks,

Best Regards

Abhishek

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Your Xml file should be like this.

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

<ns0:Employee_MT xmlns:ns0="http://sap.com/demo">

<Recordset>

<item>

<Name>vinod</Name>

<Id>12</Id>

<Age>30</Age>

<Sex>male</Sex>

</item>

</Recordset>

</ns0:Employee_MT>

In the content conversion parameters mention the following

Document name: Student_MT

Document Namespace: enter your namespace

RecordsetName: Recordset

Recoedset Structure: item,*

item.endSeparator = 'nl'

item.fieldSeparator= ,

item.fieldnames= Name,Id,Age,Sex

Hope this helps you.

Former Member
0 Kudos

hi Abhishek,

if u want o/p as :

<i>>>>Name Abhishek

>>>Age 10</i>

then try this :

Input structure :

HEADER (occurance 1..1)

---Name (occurance 1..1)

---Age (occurance 1..1)

here Name & Age r inside HEADER.

Output Structure :

NAME (occurance 1..1)

---Name (occurance 1..1)

AGE (occurance 1..1)

---Age (occurance 1..1)

Here Name is inside NAME & Age is inside AGE

in ur Receiver Communication channel:

Recordset Structure : HEADER,AGE

HEADER.beginSeparator : Name

HEADER.fieldSeparator : ,

HEADER.endSeparator : 'nl'

AGE.beginSeparator : Age

AGE.fieldSeparator : ,

AGE.endSeparator : 'nl'

Thanks,

Maheshwari.

Former Member
0 Kudos

Hi Ahmad,

I Tried what you had suggested,

In the record set structure i have specified name,1, age,2

The communication channel in the RWB gave an exception:

java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'Name.fieldFixedLengths' or 'Name.fieldSeparator' is missing

Hence the channel was not initalized.

Can you please comment.

Thanks,

Abhishek

Former Member
0 Kudos

Hello,

This should help you...

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

Former Member
0 Kudos

Hey

>>In the record set structure i have specified name,1, age,2

it must be Recordset,on receiver side we dont specify it like this,

secondly can u mail me a snapshot of ur sender and receiver data type,i m getting the impressin that ur data type is not correct

mail me at ansari.xi@gmail.com

thanx

ahmad ansari

Former Member
0 Kudos

hey

ur structure is wrong,u dont have any complex types in ur XML and thats required,u have to have one root in XML

i have mailed u the correct structure

thanx

ahmad

Former Member
0 Kudos

Hi Ahmad,

Did not receive your mail. Can you please send me the same at

av_recw@rediffmail.com.

Can you also send me the links to some Blogs which details the FCC and its constraints as specified by you,

that would be of great help

Thanks in Advance

Abhishek

Former Member
0 Kudos

Hey

u have to change ur XML structure to the following

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

<n0:rfc_proxy_message_type xmlns:n0="http://kpr.com/sample">

<Recordset>

<Name>abhishek</Name>

<Age>10</Age>

</Recordset>

</n0:rfc_proxy_message_type>

and the give parameters as

Recordset Structure = Recordset

Parameters will be as follows:

Recordset.endSeparator = 'nl'

Recordset.fieldSeparator= ,

The XML which u have right now wont work for FCC as its not contained under one tag

thanx

ahmad

Message was edited by:

Ahmad