cancel
Showing results for 
Search instead for 
Did you mean: 

steps for performing Flat file to XML

former_member187447
Participant
0 Kudos

hey,

does any one have steps for performing flat file (.csv) to XML conversion. how is the mapping in the design performed.

kalyan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

the following blog should be helpful

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

former_member187447
Participant
0 Kudos

hey guru,

so what about the design part, so there is no need to define data types. and what else need to be done in the configuration directory apart from setting up the communication channel. can u please be a little bit eloborate

thanks

kalyan.

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

Can u tell us what is the exact requirement.

Best regards,

raj.

Former Member
0 Kudos

Hey

as ur scenario is Flat file to XML,you will definitely need IR objects,coz you need to do FCC on sender side.

had it been Flat file to Flat file,you can do without IR objects

Thanx

Ahmad

former_member187447
Participant
0 Kudos

hey raj,

thanks for the concern, actually i just have an excel file which is obvoiusly a flat file(.csv) and i have to convert it from .csv to xml file and it should be sent from one ftp to other in the process. the ftp part is fine with me but i want the exact process right from IR to ID.

thanks

kalyan.

Former Member
0 Kudos

Hey

>>i just have an excel file which is obvoiusly a flat file(.csv)

how come its Flat file?its .xls and not .doc.

to handle .xls files you need to write a module .have a look at the following.

Thanx

Ahmad

former_member187447
Participant
0 Kudos

hey ahmed,

yeah i am wrong but just considering it as a .csv not an excel can you guide me through the process briefly.

thanks

kalyan.

Former Member
0 Kudos

well if the scenario is CSV to XML,then here are the steps

in IR

->Create data type for sender(DT_sender) and data type for receiver(DT_receiver)

Note:if both the sender and receiver have exactly same structure,then just create one data type.

->create message types for the above data types

->create message interfaces,one will be outbound async and other will be inbound async.

->do message mapping and interface mapping

Note:if both sender and receiver have exact same structure then no need of message and interface mapping.

in ID

->create sender File communication channel,select FCC as message protocol,give the FCC .

->create receiver file communication channel.

->complete sender agreement,receiver agreeement,interface determination,receiver determination

Thanx

Ahmad

former_member187447
Participant
0 Kudos

hey ahmed,

thanks dude

kalyan.

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

If your goal is to convert .csv to .xml without any transformations, then there is no need for IR part itself. Juz give me 5 mins , I 'll demonstrate an example in Images , in my fav . flickr

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

Consider my example, I have input file as csv structure and want it to convert into .xml file thats it.

Input file

J,24

P,22

I want the output file like

<Emp_Details>

<F1>J</F1>

<F2>24</F2>

</Emp_Details>

<Emp_Details>

<F1>P</F1>

<F2>22</F2>

</Emp_Details>

I doesn't know whether the above matches exactly ur reqmt, but there is the option.

Step 1 : Create Scenario & Business service

http://www.flickr.com/photo_zoom.gne?id=699386732&size=o

Step 2: Create sender & receiver comm.channel

http://www.flickr.com/photo_zoom.gne?id=699386698&size=o

http://www.flickr.com/photo_zoom.gne?id=699386664&size=o

Step 3:Create all the objects in ID and cross verify below whether u've created everything.

http://www.flickr.com/photo_zoom.gne?id=699386690&size=o

Step 4: Activate and run the interface.

Your results :

http://www.flickr.com/photo_zoom.gne?id=699386686&size=o

Hope it helps!!!

Best regards,

raj.

former_member187447
Participant
0 Kudos

hey raj,

i have a doubt, if we dont require IR then how is it possible to create sender agreement, receiver determination etc.. also i have another simple doubt, when we refer the file name in the sender communication channel can we put file.csv in the file name section supposing that file is the actual flat file.

thanks

kalyan.

Message was edited by:

kalyan golla

Message was edited by:

kalyan golla

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

Did u referred to the picture above. Give some dummy names as per given above. I gave the exact flow .

Best regards,

raj.

former_member187447
Participant
0 Kudos

hey raj,

this is my flat file which is saved as .csv

Adams,James,P,ABC Co.,29 Frankford Rd,Bloomington,IL,60525,708,3525555

Miller,Maria,B,Conrad Corp,1234 Smith St,Buffalo Grove,CA,60089,708,3334567

the final xml should look like this

<ContactFile>

<Contact>

<lastname>Adams</lastname>

<name>James</name>

<middle>P</middle>

<company>ABC Co</company>

<street>29 Frankford Rd</street>

<city>Bloomington</city>

<state>IL</state>

<zip>3322</zip>

<dept>708</dept>

<phone>3525555</phone>

</Contact>

</ContactFile>

.......

......

so my problem is to send the .csv file from one ftp to another ftp converted as xml.

so i am wondering how can we do it without IR.

thanks

kalyan.

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

See the below steps you need to achieve the same.

If you are using mapping , then surely u need IR. But here you are juz moving the file thats it. Hence ID part is enough. Trust me, it works!!

<b>Step 1</b>: Create New Scenario - Conversion_Interface

<b>Step 2</b>: Create New Business Service - File_System

Double click on the Business Service and add dummy Outbound/Indbound Interface name & namespace.

<b>Step 3</b>: Create New communication channels

<b>Sender _CC</b>

RecordsetName : ContactFile

Recordset Strcuture : Contact,1

Contact.fieldNames :lastname,name,middle,company,street,city,state,zip,dept,phone

Contact.fieldSeparator: ,

Contact.endSeparator: 'nl'

Rest of the objects create on seeing my picture.

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

<b><i>i have a doubt, if we dont require IR then how is it possible to create sender agreement, receiver determination etc..</i></b>.

See, if you want to create collobaration profiles/agreements , what do u need. Interface names & namespaces am I right?

In the Business Service u are adding dummy Oubound & Inbound Interfaces ,namespaces , is it? Using these interfaces create the objects.

I hope it helps, if not kindly reply back.

Best regards,

raj.

former_member187447
Participant
0 Kudos

hey raj,

thanks dude, full points to you.

regards

kalyan.

Answers (2)

Answers (2)

justin_santhanam
Active Contributor
0 Kudos

Kalyan,

If you want the exact steps, then follow the below Wiki.

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/flatFILETOFLATFILE&

In the above wiki don't do content conversion in the receiver file adapter.

Rest of the things are same.

Best regards,

raj.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>does any one have steps for performing flat file (.csv) to XML conversion. how is the mapping in the design performed.

in this case no mapping needs to be involved

you just need to use content conversion in file adapter

and that's all and it will change csv to XML

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>