cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Mail Receiver attachment name

Former Member
0 Kudos

Hi all.

we are doing a interface from file to Mail (Excel file as a attachment).

we have written the adapter module to convert the XML from PI to Excel.. which is working fine.

For the attachment name i was hardcoding the attachment name using

localejbs/AF_Modules/MessageTransformBean

and Transform.ContentDescription as Testing.xls.

The scenario works fine.

But i want the attachment name to be dynamically set like xyzddmmyyyy.xls.

I am not using any Mail package.

I want to set the attachment name dynamically. so i follwed the blog

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0922321550DB00664514007823519662End...

i am getting the filename from the xmlpayload and setting it using

xp.setName(filename);

xp.setContentType("application/vnd.ms-excel");

xp.setContent(by);

but the problem is that now i am not getting the excel file instead a untitled.bin file which have the Contents.

in module configuration i have

localejbs/XMLToExcelConversion LocalEnterpriseBean 0

sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean LocalEnterpriseBean 1

Can you please throw some light on this problem..

Thanks in advance

Babu.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Try this:

xp.setContentType("application/vnd.ms-excel; filename=\""filename"\");

Answers (1)

Answers (1)

Former Member
0 Kudos

The problem is solved using the adapter modules..