cancel
Showing results for 
Search instead for 
Did you mean: 

How to send file with original name through Mail adapter

Former Member
0 Kudos

I have to send file with original name as attachment through Mail Adapter. I am picking the file from FTP server through File Adapter. I am not using message mapping because files do not have any standard format.

Accepted Solutions (0)

Answers (7)

Answers (7)

EmmanuelJORAND
Explorer
0 Kudos

Hi Gaurav, thanks for your response...

Yes, i think ;o)

But i do a mistacke and i don't kown where...

In module, i have setup these parameters :

AF_Modules/DynamicConfigurationBean 1

AF_Modules/MessageTransformBean rename

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

1 key.0 write http://sap.com/xi/XI/System/File FileName

1 value.0 message.FileName

rename Transform.ContentDisposition attachment;filename=message.FileName

rename Transform.ContentDescription message.FileName

rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName

Result : my file name is 'message.FileName'...

Think I didnt understood properly something...

Former Member
0 Kudos

Ohh

I didnt understood properly.

Did you tried michal's method with Module.

You can capture the filename with getElementByTagName and then set it back while creating an attachment.

Even without using IR we can capture filename in Dynamic Configuration that can be used in module

Thanks

Gaurav

EmmanuelJORAND
Explorer
0 Kudos

Hi Gaurav,

Our problem (Alok and me) is that we don't use any mapping... we use a 'virtual interface' without IR access, so no UDF...

The only thing that we can do, is access to ASMA on DynamicConfigurationException module...

and i believed that SAP prefers ASMA to mail package...

I begin to think that there is no solution...

Edited by: Emmanuel JORAND on Sep 30, 2008 7:26 AM

Edited by: Emmanuel JORAND on Sep 30, 2008 7:27 AM

Former Member
0 Kudos

HI Alok

A very simple trick can solve this without building a complex code here

Get the file name using Dynamic configuration and do the following.

You need to use Mail package

in the Content_Type field

provide the value like this

<Content_Type>text/plain;name="filename.txt"<Content_Type>

generate this string using constants and filename.txt you can put using Dynamic conf

so it can be

constant(text/plain;name=") contact (UDF for filename)concat constant (")

UDF should capture Dynamic configuration parameter filename and return it.

Thanks

Gaurav Bhargava

0 Kudos

Hi Gaurav,

I had a similar scenario where file is picked up from a folder in R/3 system and sent as an attachment through mail.

I used the same mapping what you had mentioned and is using mail package and have checked keep attachments also.

I am still getting the attachment as Untitled.xml with the whole mail packae as the content in the attachment.

Is there some other configuration which needs to be done at the receiver adapter?

Thanks

Justin

0 Kudos

This was done. Please refer to this [thread|;

MichalKrawczyk
Active Contributor
0 Kudos

hi,

it can be done very easily with a simple adapter module

just have a look at my weblog:

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3202

Regards,

michal

-


<a href="https://weblogs.sdn.sap.com/pub/wlg/1843"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi,

Actually I have to set the same name of attachment which I pick through File adapter(FTP). In our Scenario we can not use any Message Mapping. So every time my attachment name will be different.

Thanks

Former Member
0 Kudos

Hi Alok,

YOu can use the 'content disposition'parameter of MessageTransformBean to achieve this..

For more info.. look at http://help.sap.com/saphelp_nw2004s/helpdata/en/84/2e3842cd38f83ae10000000a1550b0/frameset.htm

cheers,

Prashanth

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Alok,

Check this weblog...

<b></b>

regards,

Sridhar

Former Member
0 Kudos

HI ALok,

You can activate your Adapter specific paramters properties in the File adapter and use the filename to get the name of the file.

You can change the file name with the help of MessageTransformationBean.

Regards

Vijaya

Former Member
0 Kudos

Hi Vijaya,

In MessageTransformationBean we have ContentDisposition Key name to set file name. But in this we can not set file name dynamically. I have to set the attachment name by file name which we get from FTP through File adapter.

In our scenario we can not use Message Mapping.

Thanks

Alok Sarawat

EmmanuelJORAND
Explorer
0 Kudos

Hi,

Have you solve your problem ?...

I have exactly the same scenario : pik up a file (file adapter) and send it in attachment by mail adapter without mapping (no IR)...

I activated Adapter specific paramters properties in the File adapter sender and i can see the FileName tag in DynamicConfiguration section of SoapHeader in SXMB_MONI...

I want to use MessageTransformationBean... BUT, how can i 'access' to FileName tag ???...

Thanks...

I setup modules like this :

AF_Modules/DynamicConfigurationBean 1

AF_Modules/MessageTransformBean rename

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

1 key.0 write http://sap.com/xi/XI/System/File FileName

1 value.0 message.FileName

rename Transform.ContentDisposition attachment;filename=message.FileName

rename Transform.ContentDescription message.FileName

rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName

But my file name attachment is message.FileName....

Edited by: Emmanuel JORAND on Sep 29, 2008 9:23 PM

Edited by: Emmanuel JORAND on Sep 29, 2008 10:25 PM