cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with File to Mail Interface ?

0 Kudos

Hi,

I have to send a file as an attachment through email and attachment should be convert it into ".xlsx" format(in mail attachment file should be .xlsx formate) in Pi 7.31 sp 10

1.In sender side we have .txt file - we are using File FCC

2.In receiver side we have to get an attachment as .xlsx - we are using Mail adapter

3.In mapping we did one to one mapping

and in receiver module we use "localejbs/AF_Modules/MessageTransformBean"

So we converted the file into .xlsx format but we are unable to open the file.

Can any buddy help me out how to resolve this issue..

Thanks,

Siva

Accepted Solutions (0)

Answers (2)

Answers (2)

apu_das2
Active Contributor
0 Kudos

Hi Siva,

Using Format Conversion Bean is definitely a good idea. Deploy this properly and check in Application Module. If it is deployed properly. you should get the desired result.

Another Solution -

What about splitting this into 2 separate interfaces to make the requirement a bit easier.

1) First interface will be File (FTP) -> PI -> File (NFS) --- This will read txt file convert the txt into an excel file. You can achieve this easily by JAVA mapping/XSLT mapping.

2) File to Mail scenario. This will send the mail with required subject file and body along with the excel as an attachment.

Please let me know if you need any lead.

Thanks,

Apu

0 Kudos

Hi Apu,

Thanks for reply, I tried with splitting,
1. First i did File to File Using Format conversion Bean, it creating .xlsx file and i am able to open the file normally, 2.Coming to second File to Mail could you please suggest me how to read the excel file and sent the same file as attachment with same format (.xlsx) in the mail.

Thanks,

Siva

apu_das2
Active Contributor
0 Kudos

Hi,

You can follow this. It will definitely help you to complete your scenario step by step.

File to Mail with Dynamic attachment name

Thanks,

Apu

manoj_khavatkopp
Active Contributor
0 Kudos

Siva,

The 0x09 works only for excel file with .xls extension . For .xlsx you need to use custom java / module.

Try renaming the filename extension to .xls

Br,

Manoj

0 Kudos

Hi Manoj, Could you please provide any reference for the same as i am new to java/ module

Thanks,

Siva

0 Kudos

Hi Manoj,

Sorry for the late reply, i tried with this link
https://blogs.sap.com/2014/11/03/exceltransformbean-part-2-convert-simple-xml-to-various-excel-forma...



in out put we are getting xml format as output but we need in .xlsx format.

I need clarify one more thing Our Current SAP PI version is 7.31 SP10 is it possible to convert the file in .xlsx format with this version ?

Thanks,

Siva

manoj_khavatkopp
Active Contributor
0 Kudos

Siva,

That's custom module . Have you deployed EAR file from that blog into your PI system?

Br,

Manoj

0 Kudos

Hi Manoj,

EAR Files are deployed properly but unable to convert the .xlsx file, But when i did File to File using Format conversion bean it able to create .xlsx file and able to open normally.

Thanks,

Siva

manoj_khavatkopp
Active Contributor
0 Kudos

Siva,

Use scenario one from this blog :https://blogs.sap.com/2016/03/10/stop-using-mail-package-simplify-your-mail-receiver-adapter-scenarios/

Br,

Manoj