Skip to Content
avatar image
Former Member

How to send file with original name through Mail adapter

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Jun 15, 2006 at 06:58 AM

    Hi Alok,

    Check this weblog...

    <b>XI: HTML e-mails from the receiver mail adapter ?</b>

    regards,

    Sridhar

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Jun 15, 2006 at 10:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 15, 2006 at 10:35 AM

    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

    -


    XI" target="_blank">https://weblogs.sdn.sap.com/pub/wlg/1843">XI / PI FAQ - Frequently Asked Questions

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Sep 29, 2008 at 11:56 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 30, 2008 at 05:25 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 30, 2008 at 06:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 30, 2008 at 08:08 AM

    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...

    Add comment
    10|10000 characters needed characters exceeded