cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Excel file attachment of a e-mail into csv file format - Sender Mail Adapter

0 Kudos

Hi,

This is MAIL-FILE scenario.

Is it possible to convert an excel file attachment of an e-mail to .csv file format through mail adapter.

Should we use conversion agent only (or) Are there any existing solutions that I can use.

Thanks,

Lakshmi.

Accepted Solutions (0)

Answers (2)

Answers (2)

udo_martens
Active Contributor
0 Kudos

Hi,

you can use Conversion Agent, here is a nice blog of Alex Ong.

But there are some alternatives, Michal described them and eloborated a much easier method: PI/XI: Reading MS Excel's XLSX and XLSM files with standard PI modules - easily...

/Udo

gagandeep_batra
Active Contributor
0 Kudos

Hi Lakshmi,

I think you can achive this using PayloadSwapBean and PayloadZipBean

check the below link that may help you

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/12/06/pixi-

reading-ms-excels-xlsx-and-xlsm-files-with-standard-pi-modules--easily

Regards

Gagan

0 Kudos

Hi Gagan,

Thanks for the reply.

I am already using PayloadswapBean to read the attachments,but now my question is whether we can convert this excel attachment to .csv file format with any existing beans or not. Should we use conversion agent?

gagandeep_batra
Active Contributor
0 Kudos

Hi lakshmi,

i think ones you got XML file in IE then you  at receiver side you can go for FCC to convert you xml to  CSV

Regards

Gagan

0 Kudos

Hi Gagan,

I have tried using the option you suggested.But I receiv following error during FCC and I cannot see XML file in any of the monitoring tools.So, I am not sure if the fcc parameters are correct. Following are my excel attachment and fcc details.

I receive this error "File processing failed with java.lang.Exception: Exception in XML Parser (format problem?):'org.xml.sax.SAXParseException: Content is not allowed in prolog.'

Thanks,

Lakshmi

gagandeep_batra
Active Contributor
0 Kudos

hi ,

i think it's not converting the excel file in xml in proper way, first try without fcc and check whether XML is created or not then do for FCC

check below blog for more information:

http://scn.sap.com/people/gaurav.agarwal11/blog/2012/04/12/handling-attachments-in-mail-to-file-scen...

Regards

gagan

0 Kudos

Hi Gagan,

What you said is correct.The xml generated is not in right format and I am stuck here.

I think I have to use conversion agent or other adapter module. Gaurav blog has xml attachment but I have xls attachment.

Let me know your thoughts.

Thanks,

Lakshmi

0 Kudos

Following is my configuration and trace in the logs. For some reason,swapping and zipping is not in order.

I am unable to find out what is going wrong.