Skip to Content
0

Issue with File to Mail Interface ?

Jul 07, 2017 at 02:21 PM

107

avatar image

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

1.png (14.1 kB)
2.png (3.8 kB)
capture.png (9.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Manoj K Jul 07, 2017 at 02:46 PM
0

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

Show 6 Share
10 |10000 characters needed characters left characters exceeded

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

Thanks,

Siva

0
0

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-formats-easily/



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

error.png (10.0 kB)
0

Siva,

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

Br,

Manoj

0

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

0
0
Apu Das Jul 11, 2017 at 03:16 PM
0

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0
0