Mail Adapter: original Attachment filename retrieval in Proxy

Hi,
I have a Sender Mail Adapter, and the receiver is a proxy, where I need to get the attachment and its details.
When I execute
attachment_filename = l_attachment->GET_DOCUMENT_NAME( ).
it simply returns Attachment-1 etc.
How do I get the original attachment filename?
I am on SP16.  
Regards,
Puloma.

HI
Please refer tihs thread for mail attchments
Re: Handling attachments of mail
Scenario to pick the mail with its attachments into XI\Re: Infrastructure required for Mail Adapter

Similar Messages

  • Receiver Mail Adapter with Attachment and Mailpackage

    I have set up a scenario
    filesystem: filexxx.xml filexxx.pdf
    xml= mailpackage format to get the receiver mailaddress
    pdf=the file i want to send as a attchment.
    I am using the RenemAttachment module i found on SDN.
    in SXMB_MONI it looks ok,  the attachment name is filexxx.pdf application/pdf
    But when i look at the mail send it shows as attachments
    Untitled.txt and Untitled.pdf
    Any id's
    I only want to send the mail woth one attachment, the original pdf as a attchment.
    tnx

    Issue should be solved with SP17.
    I solved by putting the attacgement into the content part of the message.
    like.
    <?xml version="1.0" encoding="ISO8859-1"?>
    <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
         <Subject>Greenery:TESTTEST</Subject>
         <From>customerservicedesk@xxxxxxx</From>
         <To>Peter.schults@xx</To>
         <Content_Type>application/pdf; name=TEST.pdf</Content_Type>
         <Content_Description>PDF FAKTUUR</Content_Description>
         <Content_Disposition>attachment; filename=TEST.pdf</Content_Disposition>
        </ns1:Mail>

  • Mail adapter with attachment

    hello
    I have a mail sender adapter with attachment, that I would like to transfer to other PI.
    the important is to keep the attachment and to deliever it to the PI
    any ideas?
    Kfir

    Hi,
    By using Java mapping, you can easily achieve this.
    Or use Adapter module 'PayloadSwapBean '.
    Please see the below blogs, it might be helpful to you.
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
    Regards,
    Rajesh

  • Xi sender mail adapter with attachment (to Web Service w/ attachment)

    Hello,
    We're working on an XI scenario wherein a sender mail adapter polls an exchange server inbox for mail (with attachment)and sends the attachment to a Web Service via SOAP Adapter? Does anyone know if this is doable, and if so, how?
    Thanks,
    Eric

    Hi!
    I think so, if you just have a single attachment to be transferred.
    Use the Mail Sender Adapter and specify the MailServer URL etc...
    In the Module provessor of the Mail-Adapter you have to specify the PayloadSwapBean ( -> this changes the payload - the attachment becomes the payload)
    then you configure the standard XI-scenario with
    SenderAgreement
    Mapping if necessary
    Receiver Agreement
    Receiver adapter
    kr Martin

  • Receiver Mail Adapter - Avoid attachment

    Hello
    Could anyone please let me know, how to prevent a mail attachment with a Receiver Mail Adapter. I have chosen XIPAYLOAD as Message Protocol. When the mail is received there is no mail body, instead only the attachment contains the message.
    Thanks
    John Jeyaraj

    Hi,
    Use Mail XSD as target structure in your mapping and enable use Mail package in your receiver channel...
    for avoiding attachments..
    HTH
    Rajesh

  • Mail Adapter ContentDisposition attachment

    Hello,
    We have goot a big Problem with the Mail-Adapter at PI.
    The Adapter generated:
    MIME-Version: 1.0
    Content-ID: <mail-9674f6c0d03711de86dc00144fb7b1f0>
    Content-Disposition: inline
    Content-Type: multipart/mixed; boundary="AaBb--984dfgeSSd3532"
    Content-Transfer-Encoding: binary
    Message-ID: <MA-EX051w920foGAl6g0001065b@xxxccc>
    X-OriginalArrivalTime: 13 Nov 2009 09:33:23.0294 (UTC) FILETIME=[58264FE0:01CA6444]
    But we need:
    MIME-Version: 1.0
    Content-ID: <mail-9674f6c0d03711de86dc00144fb7b1f0>
    Content-Disposition: inline
    Content-Type: multipart/mixed; boundary="AaBb--984dfgeSSd3532"
    Content-Transfer-Encoding: attachment
    Message-ID: <MA-EX051w920foGAl6g0001065b@cccxxx>
    X-OriginalArrivalTime: 13 Nov 2009 09:33:23.0294 (UTC) FILETIME=[58264FE0:01CA6444]
    We use as Bean: localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    Transform.ContentDisposition attachment
    Could someomene help us.
    Thanks and bye bye
    Marc

    Hi Marc,
    Didnt get your requirement correctly!!!
    You want the payload as an attachment to mail?? If yes the in receiver mail adapter select keep attachments and choose XIPayload
    Regards
    Suraj

  • Receiver Mail adapter - Text attachment

    Hi Folks,
    sorry to post again & again same issue.
    if i want to achieve (proxy 2 mail scenario) Payload as text attachment in email,
    do i need to use below 2 modules in My receiver CC?
    Number 1 as AF_Modules/StrictXml2PlainBean
    Number 2 as AF_Modules/MessageTransformBean
    is it right (the order which i used and Modules which i used)?
    Screen shot link of my config:
    http://farm4.static.flickr.com/3071/2951413865_498cb4f19b_o.jpg
    http://farm4.static.flickr.com/3027/2951427759_d4d3097826_o.jpg
    did i make any mistake on my config?
    Rightnow i am getting Business content data in the email message inbox only. I am not getting Business data as a attachment.
    do i need to use PayloadSWAPBean module also to achieve my req.?
    Inputs reg. this will be helpful.
    Thanks
    Praba

    HI Gaurav,
    I tested again for ur Try
    With XIALL option  - i am getting 2 files in a attachment
    file name: ATT00001.xml  - control records -
    output file name : Untitled.xml - Payload (business data)
    file name: ATT00001.xml  as a attachment in the email
    - XI PAYLOAD  with out any module( but default sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean - module will be there), with out keep attachments option
      output file name : Untitled.xml  as a attachment in the email
    XI Payload  with out any module ( but default sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean - module will be there), with keep attachments
    any one has idea on this, plz throw some inputs
    Thanks
    Praba

  • Setting dynamic attachment name in mail adapter

    Hi experts,
    I have a mail adapter that send e-mails from ECC to several address.
    I have configured dynamically the FROM and TO field using the code showed below in message mapping:
    public String SetMailParameters(String Mail_address_to, Container container){
       //write your code here
      String valueFrom = "my_address";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderFROM");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderTO");
    conf.put(key1, valueFrom);
    conf.put(key2, Mail_address_to);
      return  "";
    In communication channel I have checked ASMA and variable transport binding (using XHeaderName1 and 2), mail package is not checked.
    It works fine!
    My question is:
    I need to dynamically configure also the Attachment name: is it possible?
    I've tried adding the code below:
    DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key3,Attachment_name);
    and also
    Transform.ContentDisposition      attachment;filename=<FileName>
    in Message TransformBean in communication channel, but it doesn't work!!!
    Any idea?
    Thanks
    Fabio Boni

    Hi,
    thanks a lot!!
    ASMA and variable transport binding must be checked or not?
    it raise an error in runtime workbench message monitoring:
    2010-09-02 17:41:15 Success Mail: calling the adpter for processing
    2010-09-02 17:41:15 Error Mail: call failed; com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Success Mail: sending a delivery error ack ...
    2010-09-02 17:41:15 Success Mail: sent a delivery error ack
    2010-09-02 17:41:15 Error Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Exception caught by adapter framework: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1.
    This is my message in message monitoring:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Content_Disposition>"attachment; filename="MyFileName.txt"</Content_Disposition>
      <Content>ZLF;0001000079;Dealer Motors UK</Content>
      </ns1:Mail>
    In message mapping with target message mail package I've linked Content_Disposition with the constant
    "attachment; filename="MyFileName.txt"
    If I cancel this relation the mail arrives correctly.
    One other thing: when I took mail.xsd from SAP the fields Content_Disposition and Content_Description weren't in, so I added them manually in XSD.
    thanks
    Edited by: Fabio Boni on Sep 2, 2010 5:42 PM
    Edited by: Fabio Boni on Sep 2, 2010 6:06 PM

  • Mail adapter issue with mail attachment

    Hi all,
    I have a scenario mail to file and i have a problem.
    Is it possible, in a sender adapter mail to use the option keep attachment and mail package at the same time ?
    So,is it possible to use the module payloadswapbean and XMLanonymizer in a sender adapter mail in order to suppress a namespace from the attachment in it ?
    Is the option mail package useful if i am using payloadswapbean module ?
    from what i see, It seems that the XMLanonymizer doesn't work for sender mail adapter with attachment. I've tested the configuration on a sender adapter file and works fine.
    Anyone already tested it ?
    Thanks,
    Jean-Philippe
    Edited by: Jean-Philippe PAIN on Feb 9, 2010 5:29 PM

    Hi Stefen,
    Thanks for the answers.
    The question is, whether the payloadswapbean is useful at all in a sender mail scenario.
    I don't understand this one ! Isn't mandatory in sender adapter mail scenario if you want to read your mail attachment ?
    Yes. If you configure the payloadswapbean correct, the XMLanonymizer works on the attachment.
    It is not easy to set the payloadswapbean in a correct way. IPost your parameters here, when it does not work for you.
    Ok. Maybe my configuration is wrong, please tell.
    Processing sequence :
    localejbs/AF_Modules/PayloadSwapBean => 0
    localejbs/AF_Modules/XMLAnonymizerBean => 1
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean =>mail
    module configuration :
    swap.keyName =>Content-Disposition
    swap.keyName => Content-Description
    swap.keyValue=>MailAttachment-1
    swap.keyValue=>attachment;filename="MailAttachment-1.xml"
    anonymizer.acceptNamespaces =>http://namespace ''
    anonymizer.quote => ''
    I am on PI 7.1 version and when i am looking in the monitoring(sxmb_moni), it doesn't seems working.
    Thanks,
    Jean-Philippe
    Edited by: Jean-Philippe PAIN on Feb 10, 2010 10:36 AM

  • Sender Mail Adapter Content Conversion

    Hi All,
         I just want to know if we can send a flat file(Rather Than the XML) with content conversion using Mail Adapter. If yes then what are all the possible ways for this.
    I have tried but i am sucessful in sending the complete payload as a XML file, but i want the file with the content conversion, so that this should be able to picked by the third party systems.
    Will be oblidge if any supported blog or pdf is provided for the same.
    Thanks in Advance.
    Jay

    Hi,
    Now for the negative items, i want to send them back to business as flat file format
    using the mail adapter as attachment. This will help them to process the file as for there
    requirement.
    Since you need to send an email message you have to use the format mentioned here: (S-UserID required)
    https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt
    Save this file as an XSD in you local system and upload it as an External Definition in your XI server.
    Develop MI based on this External Definition (IN, ASYNC)
    Create an Interface Mapping with Source as the file containing Negative items and target as the above developed MI
    Now you need to develop an XSLT mapping (can use StylusStudio to do it) between the source and target Message Types
    This XSLT mapping has to be designed in such a way that it extracts the payload out of the Negative Items message and maps it to the target (Content) field....you need to use CDATA element of XSLT here.
    In this mapping itself you can define to what email-id you want to send the message.....
    Everything happens on the XI --> Business service side...so it is not the sender channel but is the receiver channel:)
    Your XSLT mapping will look something like:
    <Mail>
         <Content>
              XSLT CODE
         </Content>
    </Mail>
    where Mail and Content are the tags in the email message format...the External definition one.....
    If you are new to XSLT then refer to my answer in this thread...
    Re: JAVA MAPPING
    regards,
    Abhishek.

  • Retrieval of attachment filename - receiver mail adapter

    Hi,
    I am using the mail adapter to receive an e-mail into PI. This e-mail has an attached CSV file.
    First, I am using the PayloadSwapBean to swap the application playload to the attachment payload
    Second, I am using the MessageTransformBean to transform the CSV file into an XML document
    These are both working fine and the message is then passing into the relevant message mapping.
    However, I would like to be able to use the attachment filename in the message mapping.
    Can anyone advise how to do this for the mail adapter ?
    I've done it loads of times for the file adapter but never the mail adapter (when using attachments) so I am a bit stumped.
    Any advice greatly received.
    Cheers
    Colin.

    Hi Progirl,
    I want to dynamically set the name of attachment in receiver mail Communication Channel.
    Example: IN__9907211000004_4048454000005_20081211_01000000002643
    The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
    20081211 this is the date and
    And againg this number 01000000002643 is read from message.
    I read from your response. You had created adapter module for the similar purpose. Can you share it. Since I am new to  writing Adapter Module.
    Thank You in Advance.
    Mukhtar

  • How to send original filename as the attachment name through mail adapter?

    Hi,
    I have a File to Mail scenario where the file is picked up from a folder in R/3 system and is sent as an attachment through mail. The requirement is to send the file unconverted and with the same file name.
    When tried without creating any ESR objects, it was sending the file with the name Untitled.xml.
    Since the filename has to be picked dynamically, I am not able to configure it through module parameters also (where we can set it through Content_Disposition)
    I tried configuring it as mentioned in the following link: [http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=138084630]
    But still it is going as Untitled.xml with the whole mail package as the content of the attachment.
    Any pointers to solve this issue will be of great help.
    Thanks
    Justin

    there is no standard way so you will  have to write module beans.
    in other way:
    XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping - XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    Dynamic name in the mail attachment - pseudo "variable substitution" :
    XI: Dynamic name in the mail attachment - pseudo "variable substitution"
    Dynamic attachment name in receiver mail adapter

  • Mail-Adapter adds ".bin" to filename of attachment

    Hi!
    I'm sending mails with a dynamic generated filename using the mail-adapter and mail-package. The file extension of the attachment should be ".txt" and the content-type should be "application/EDIFACT"
    When I change the content-type of the attachment in my adapter module by
    TextPayload attachment = msg.createTextPayload();
    attachment.setName("something_dynamically_generated.txt");
    attachment.setContentType("application/EDIFACT");
    The content-type is changed properly, but the file extension ".bin" is added.
    The result is in my example:
    something_dynamically_generated.txt.bin
    How can I stop XI from extending my filename?
    I tried with the MessageTransformBean, but it had no effect.
    Best regards,
    Daniel

    Hi Sudharshan,
    we upgraded from SP15 to SP18, then the problem occured no more.
    I created the attachment in an adapter-module for the mail adapter. Sample code:
    TextPayload attachment = msg.createTextPayload();
    attachment.setContentType("Application/EDIFACT");
    attachment.setName("SomethingDynamicallyGenerated.txt");
    attachment.setText(string_which_contains_the_new_payload);
    msg.addAttachment(attachment);
    It seems that the mail adapter checks now if a filename extension is given. If this is the case, it adds no extension by itself.
    I tested different configurations like mail package and variable transportbinding / adapterspecific attributes, it worked every time.
    Best regards,
    Daniel

  • Receive CSV attachment via Mail Adapter and process into ABAP proxy

    Hi,
    I have the following scenario:
    1. Receive e-mail with CSV attachment
    2. Process through Mail adapter (KeepAttachments = Yes in order to retain the CSV attachment)
    3. Receive into ABAP proxy (with CSV attachment)
    The next step is to read the attachment in the ABAP proxy and process the CSV attachment data into CRM.
    The CSV attachment contains the data I wish to process - the body of the e-mail will not contain this information.
    The problem I have is reading the attachment data in the proxy - not sure of the methods/class to call - anyone got any ideas ?
    Another question is this the best way to do this and process the CSV attachment data ?
    I know I could use the PayloadSwapBean to switch the payload to the attachment but then I am stumped with how the attachment is processed through PI 7.1 - how do you transform the CSV format payload into XML so PI will be able to process it through mapping.
    Either option is viable - an answer to either question would be great.
    1. How do you read the attachment data in an inbound ABAP proxy ?
    2. How do you transform the CSV attachment data after the PayloadSwapBean from CSV to XML ?
    Kind regards
    Colin.

    Hi Colin
    As you are not interested in processing the body of email. Swap the payload to the attachment using the PayloadSwapBean
    Change the content from CSV to XML using MessageTransformBean. Now pass this information to Proxy. You dont need to deal with attachments in proxy.
    It is not possible to read attachment in server proxy because the class and interface you create will not have data type which can refer to an attachment processing interface in ABAP.
    Thanks
    Gaurav

  • Dynamic config for attachment without any message mapping in mail adapter

    Hi,
    In our scenario, we are not using any message mapping as a specification.A fixed length file is sent from source via proxy as an attachment to the mail.
    here the issue is with the file name of the attachment. how do we configure the attachment file name dynamically with out using any message maping.
    Regards,
    Divya

    Hi Divya,
    I understand you want to set name for mail attachment.
    SAP Note: Mail Adapter sapnote_0000856599
    Q: Can I choose the name of an attachment in the mail?
    A: Yes. Most mail clients use some heuristics based on some *MIME headers to derive the name of an attachment.* The MIME headers involved in most heuristics are Content-Type, Content-Description,and Content-Disposition. When you create an XI message, the XI payload name is automatically set in the Content-Description. If you want to change or set all of these headers, you can use the MessageTransformBean module (Note 793922) [Link|http://help.sap.com/saphelp_nwpi711/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm]
    in the adapter framework.
    Q: How can I set the file name of a mail attachment?
    There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:
    Content-Type: application/xml; name="abc.xml"
    RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.
    With this Content-Disposition header, you can set the file name as:
    Content-Disposition: attachment; filename="abc.xml"
    Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in
    Content-Description: my xml file
    To avoid potential interpretation problems, it is recommended to combine the use of these headers.
    Regards,
    Raghu_Vamsee
    Edited by: Raghu Vamsee on Feb 3, 2011 12:23 PM

Maybe you are looking for

  • Cancelling out of enterprise e-mail set up

    Can someone help - I have a Curve 9320 - I went into set up e-mail and must have gone to enterprise activation instead of general e-mail. Now I cannot get back to the original set up screen as the request for an enterprise account activation always c

  • Graph axes assignment: performance difference between ATTR_ACTIVE_XAXIS and ATTR_PLOT_XAXIS

    Hi, I am using a xy graph with both x axes and both y axes. There are two possibilities when adding a new plot: 1) PlotXY and SetPlotAttribute ( , , , ATTR_PLOT_XAXIS, ); 2) SetCtrlAttribute ( , , ATTR_ACTIVE_XAXIS, ) and PlotXY I tend to prefer the

  • Loading in the background

    Hello, I have a problem with the iphone 5. When I'm at home without any open application icon appears next to the wifi icon in the form of clock showing that something is loading, but if I enter an application loading icon disappears, the background

  • Object Services - Adopting attachment from Req to PO

    Hi All, After adding an attachment to a requisition using Object Services, I'd like to bring the attachment forward to the PO during the 'Adopt' process. I know I can add the attachment to the PO using the same process, but is there an automated way?

  • Why the system tablespace increase a lot?

    I have noticed that the system tablespace of my prod Oracle 10g R2 on AIX 5.3L reaches over the 85% warning level now, and the size has increased from ~68% to 88% of 1.6G total assigned capacity during the last 7 months. How do i find out what reason