Payload as attachment

Hi all,
I want to know If there is any standard module to save the payload an attachment.
Regards,
Ivá

Hi,
You can Have a Sender file Adapter to Pick the File as a payload and as a Attachment but:
The Transport Protocol should be NFS
Your receive should be capable of handling Payload as well as attachment which is in your case "FILE" and Receiver file adapter does not support this, May be having Custome module in the Receiver file Adapter will help.
Refer Following Links:
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/frameset.htm
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1685 [original link is broken]
Thanks,
Sunil Singh

Similar Messages

  • Swap payload to attachment

    Hi experts,
    is there any way to swap payload to attachment except deploying a custom module in a receive SOAP adapter?
    Regards,

    Hi,
    Please try the PayloadSwapBean.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm

  • Sender mail adapter : How to get mail in both payload AND attachment ?

    Hi,
    I need to get the mail content both ways every time :
    -In attachment in order to store it later.
    -In payload in order to use it.
    I don't see any way to do this. Any ideas ?
    JB.

    Thanks for that fast answer.
    But I have no problems with reading the payload content or accessing any attachment.
    My issue is the following : I need to push the payload content as an attachment before sending the message to the Abap Proxy.
    Scenario is the following :
    Mail box --> PI --> ECC/Abap Proxy.
    I already store all the attachment during the proxy execution, I would like to be able to do the same withe the mail content.
    Edited by: JB CABIRO on Jan 13, 2012 4:12 PM

  • XML Payload with attachment idoc to rnif

    Hi Experts,
    I am doing the scenario Idoc to RNIF. i have to pick up some1234 .pdf , fieldticket.pdf files and attached to the xml payload of out put and send it to the customers. How can we do this. please any one help me. If you have any documents please send me.

    Anyone working/worked with RNIF adapter would like to share their experience.

  • Payload as Attachment in mail

    Dear All
    I have an XML file which I need to convert to a flat file and send as a mail attachment.
    The problem is that I dont want the payload of the file to be a part of the message text.
    Please suggest a solution
    Sourabh

    use receiver mail adapter and select message protocol as XIPAYLOAD.
    select Use mail package option and keep attachment
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID0986209050DB01214330626217561050End?blog=/pub/wlg/1798
    refer this for how to use Use mail package option http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417500)ID0528701850DB00303731739768576528End?blog=/pub/wlg/1361
    as explained in this blog You need Mail.xsd as receiver message type .there is a field Content_Type inside this structure pass
    Text/plain to this field.the attachment created will be Untitled.txt.
    If you want to give a name to the attachment  you have to Use MessageTransformationBean

  • Receiver Mail Adapter, Mail Package with Payload as Attachment

    Hi Everyone,
    I have spent the better part of the day today searching and testing all of the different combinations that I could think of to solve this problem, so please don't just do an SDN search for me and cut/paste in the links as there are too many contradictive answers piling up over the last year.
    I am trying to use a Receiver mail adapter to send some data using the mail package, and I want to have the <content> tag be in an attachment.  I am using mail package to dynamically set the mail address, but to also try and turn my data into a csv file that the recipient can open in Excel.
    My mail package sets the following values:
    <Content_Type>text/plain</Content_Type>
    <Content_Disposition>attachment</Content_Disposition>
    <Content>Sample Text</Content>
    This blog is basically what I am trying to do: 
    <a href="/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword:///people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    But no where in here is he setting ContentDisposition, and he is (potentially) not using the MessageTransformBean module.
    It is unclear if I need to use the MessageTransformBean to make this work? 
    Questions:
    1) Do I need to use the MessageTransformBean?
    2) Do I need to set the ContentDisposition in the mail package?
    3) Does Service Pack matter with these settings?  We are on SP15 upgrading to SP18 very soon.
    Thanks
    Peter

    Hi Peter,
    try:
    <Content_Type>text/plain;name="file.csv"</Content_Type>
    <Content_Disposition>attachment;filename="file.csv"</Content_Disposition>
    <Content>Sample Text</Content>
    Regards
    Stefan

  • SOAP To File (Attachment swapping with Payload using Payload Swap Bean)

    Hi,
    I am working on the subject line. The scenario works well and good when I use the bean in Receiver File Communication Channel.
    The same bean configuration if I use on the sender SOAP the swapping of payload and attachment is not happening.
    Any Ideas.............
    Thanks,
    - Gujjeti.
    Edited by: Praveen Gujjeti on Feb 27, 2009 1:53 PM
    Edited by: Praveen Gujjeti on Feb 27, 2009 1:53 PM

    Hi Praveen,
    Clearly written in SAP help document :
    "SOAP sender Adapter does not support Moduls"
    so using Payload swipe bean is all van.
    Thanks
    Sunil Singh

  • How can I read mail attachment for making it to the payload?

    Hi everybody,
    in the following my scenario:
    I have an incoming message with attachment by the mail sender adapter using PayloadSwapBean (because of other messages I have to use the bean). I want to send this attachment by using the mail receiver adapter to fix E-mail-address keeping the FromMailAddress, the MailSubject and the FileName
    without the metadata as additional attachment.
    I have found a thread where it is explained how to handle "payload as mail attachment and dynamic filename" by java-mapping. So far so good. My question is: How can I make my attachment to be the payload? How can I read the attachment by java-mapping?
    Thanks for help.
    Reagrds,
    Sebastian Linke

    USe payloadSwapBean for this to swap your payload and attachment
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Rajesh
    Edited by: Rajesh on Feb 5, 2009 5:29 PM

  • Using the Mail content and Mail Attachment in the mapping

    Hi,
    I have a requirement in which I need to read a file from the mail server and I am using the sender mail adapter for this. I have to convert the attachment of the mail in to the payload. To do this I am using the payload swap bean and mail transform bean. Now the issue is I have to get the information from both attachment and the mail content and need to map it to the target message. Please let me know how to do this.
    Thanks!
    ~Vaas

    Not sure if there is a staright forward way to achieve this.
    But I can think of a work around for your scenario.
    >>To do this I am using the payload swap bean and mail transform bean.
    Instead of doing it this way, try
    1. Message Transform bean that will transform the payload(content of the mail) to XML.
    2. PayloadSwapBean to switch Payload and Attachment.
    3. Message Transform bean to transform the attachment to XML.
    4. Custom adapter module to read the attachment, contnet and create your own desired XML.
    Alternatively, step 4 could be replaced by a Java mapping doing the same operation.
    Regards
    Jai

  • Mail : Mail Payload doesn't changes to inline (body) still become attachmen

    Hi,
    I have scenario ABAP Proxy (Main Payload + attachment) ---> Mail (XIPAYLOAD + Mail Package + keep attachment).
    =========================== ABAP PROXY OUT ASYN ===========================
        attachment_protocol ?= prxy->get_protocol(
        if_wsprotocol=>attachments ).
        attachment = attachment_protocol->get_attachment_from_binary(
               data = attach_xstring
               type = if_ai_attachment=>c_mimetype_text_plain
               name = 'Outmail' ).
        APPEND attachment TO attachments.
        attachment_protocol->set_attachments( attachments ).
        it-mt_source_proxy-to = 'XXXXXXX'.
        it-mt_source_proxy-subject = 'Test email with attachment'.
        it-mt_source_proxy-content = 'ccccccccccccccccccccccccccccc'.
        CALL METHOD prxy->execute_asynchronous
          EXPORTING
            output = it.
        COMMIT WORK.
    =========================================================================
    So the result is both payload become attachment. Now the problem is how to change the main payload to become body of email and still keep the attachment become mail attachment.
    I have configure PayloadSwapBean and MessageTransformBean in mail adapter receiver as below :
    1. localejbs/AF_Modules/PayloadSwapBean             swap1
    2. localejbs/AF_Modules/MessageTransformBean      type2
    3. localejbs/AF_Modules/PayloadSwapBean             swap2
    4. localejbs/AF_Modules/MessageTransformBean      type1
    swap1   swap.keyName                                  payload-name
    swap1   swap.keyValue                                  Outmail
    type2    Transform.ContentDescription             Outmail
    type2    Transform.ContentDisposition             attachment;filename="abc.txt"
    swap2   swap.keyName                                 payload-name
    swap2   swap.keyValue                                 MainDocument
    type1    Transform.ContentDescription            MainDocument
    type1    Transform.ContentDisposition            inline
    But then the main document content still in attachment cannot change to body eventhough i have put inline in Transform.ContentDisposition.
    Please advise, what i am missing in this configuration.
    Thank you and Best Regards
    Fernand

    For all, who searches a way for this scenario:
    you could write a java mapping and use it after the last other mapping in operation mapping. Use this coding for it:
    import com.sap.aii.mapping.api.*;
    import java.util.*;
    import java.io.*;
    public class MappingPayloadAttachment extends AbstractTransformation{
        public void transform(TransformationInput input, TransformationOutput output)
           throws StreamTransformationException {
            getTrace().addInfo("JAVA Mapping Called: MappingPayloadAttachment");
            try{
                InputPayload inpayload = input.getInputPayload();
                InputStream instream = inpayload.getInputStream();
                String instring = this.convertStreamToString(instream);
                InputAttachments inAttachments = input.getInputAttachments();
                OutputPayload outpayload = output.getOutputPayload();
                OutputStream outstream = outpayload.getOutputStream();
                OutputAttachments outAttachments = output.getOutputAttachments();
                //create Output-Payload
                outstream.write(instring.getBytes());
                //copy attachments
                if(inAttachments.areAttachmentsAvailable()){
                    Collection<String> colAttIds = inAttachments.getAllContentIds(true);
                    Iterator<String> attIDsIt = colAttIds.iterator();
                    while(attIDsIt.hasNext()){
                        outAttachments.setAttachment(inAttachments.getAttachment(attIDsIt.next()));
                }else{
                    getTrace().addInfo("MappingPayloadAttachment Information: no attachment available.\n");
            }catch(Exception e){
                StreamTransformationException ste = new StreamTransformationException(e.toString());
                throw ste;
        public String convertStreamToString(InputStream in){
            StringBuffer sb = new StringBuffer();
            try
                InputStreamReader isr = new InputStreamReader(in);
                Reader reader = new BufferedReader(isr);
                int ch;
                while((ch = in.read()) > -1) {
                    sb.append((char)ch);}
                    reader.close();
                }catch(Exception exception) { }
                return sb.toString();
    And don't forget to check the cross for "Read Attachments" in Operation Mapping configuration. Now you should be able to config the payload as mail body (inline).
    Regards,
    Dirk

  • Reading an PDF Attachment  From Sender Mail Adapter

    Hi All,
                   i am able to get a mail  from my Mail Server, But my aim is need to Read an PDF attachment from the mail, in SXMB Moni i am getting the Payload with attachment, I have a created a module to convert that PDF to XML(Module is working fine in file to file sceneraio) .
    In adapter should i need to use Payload Swap Bean Module also , because in sap help said that i need  Select Keep Attachments. I want to know how that how to Push the PDF attachment to My Custom Module which is used to convert the PDF To XML.
    If Payload Swap Bean Module needs to be Used , please tell me the Key Names and Key Values to be used.(swap.keyName,swap.keyValues)
    Thanks and Regards,
    Kamal
    Note: Points will be awarded

    Kamal...
    See if this helps
    [Module Name]
      AF_Modules/PayloadSwapBean
    [Module Parameters]
    The following parameters are used for this module
      swap.keyName          the name of a supported attribute.
      swap.keyValue         the value of a partial string that is required
                            to appear.
    The supported attributes (swap.keyName) include the payload attributes
    such as payload-name, payload-description and any content attributes
    such as content-type, content-disposition, content-description, etc.
    Regards
    Ravi Raman

  • In Receiver Mail Adapter ,how to ignore SOAP Header attachment

    HI Folks,
    Am using Receiver Mail Adapter and am getting 2 attachments.
    1. one is Soap header which contains Control records
    2. payload
    I want only Payload as attachment and need to ignore SOAP Header(AT00001.xml).
    The configuration is as below:-Trasport protocol : SMTP
                                                Message Protocol: XIALL
    Please provide Inputs.
    Thanks & Regards
    Ashok Reddy

    Hi Gagandeep,
    Scenario: File------>mail( Bypass scenario)
    i had posted file in FTP and am getting attachment properly but aditionally am getting ATT00001.xml as SoapHeader.this i need to ignore.
    PFB Module Parametrs i used:
    localejbs/AF_Modules/MessageTransformBean   LocalEnterpriseBean    transform
    Modulekey                      Parameterattribute                        value
    transform                      Transform.ContentDisposition            attachment;filename=”Pocr_860.txt”
    transform                     Tansform.ContentType                       text/plain
    Regards
    Ashok

  • Mail Receiver and Attachment Issue - how to get an attachment into the body

    I have an abap proxy that sends a simple message to XI with a pdf attachment. XI maps the xml message to the Mail Adapters Mail Package format.
    To have the email sent with the PDF attachment I must click the "keep attachments" option. However this also has the side-effect of making the message payload an attachment as well (seems silly?). Therefore I get an email with two attachments: one is the PDF and the other is the plain text that should be in the email body.
    The question is: How do I get that plain text attachment back into the Message Body ? I have tried all combinations of the MessageTranformBean and the PayloadSwapBean with no luck.
    I can easily change the names of the attachments with the MessageTransformBean but if I set the text attachment to Transform.ContentDisposition inline, it still just comes out as an attachment. And, if I use the payloadswapbean the adapter log says it corectly swapped the right payload however the email still comes out with the text as an attachment!!
    Any ideas on how I can do this? Is it a bug in the module beans?
    (I'm using MS Outlook as the email client.)
    Maybe I need to write my own module bean to do this... If I set keep attachments to OFF, can I still set the PDF attachment with my own modules (the reason I ask this is that with keep-attachment OFF, the message body correctly has the text in it...
    Regards,
    Jason.
    Edited by: Jason Scott on Mar 6, 2008 3:22 AM

    Hi,
    Check these
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    Regards
    Seshagiri

  • Extra header lines appearing in payload after singning and encrypting in Mail Receiver adapter PI 7.31

    Hi,
    We have a mail receiver adapter which is sending out a edi payload as attachment to the external receiver.
    When we send the normal .edi file it is ok.
    But when we sign and encrypt the payload and send it out, the external customer receiver decrypts and validates the message successfully but when their application tries to read the edi payload it finds the extra header lines as below :
      content-id:
    <[email protected]>
    Content-Disposition: attachment; filename=xxxxxxxx.edi Content-Type:
    application/xml
    At their end, their application (DataPower) expects the first three characters of the payload
    (decrypted payload) to be either UNA or UNB.This is how it validates whether the incoming message is an EDI message.
    But it encounters the extra MIME headers in the payload.
    Therefore it gets rejected by DataPower which thinks the content is an
    unknown message type.
    How to suppress the header lines appearing in the payload(after decryption and validation).
    Thanks,
    Guest

    hi,
    try content-type as "text/xml"

  • Dynamic attachment name with receiver mail adapter and use mail package

    We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).
    I could probably do this using the adapter module (as per the following link),
    http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
    I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?

    Hi,
    1) XML payload as attachment (with dynamic name)
    2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
    These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
    The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
    <?xml version="1.0"; encoding="UTF-8"?>
    <p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
    <Subject>My Invoice</Subject>
    <From>from email address<;/From>
    <To>to email address</To>
    <Content_Type>text/plain;name="MyFile.csv";</Content_Type>  --> file name here
    <Content>123;A49;aaa</Content>   -> attachment xml here
    </p2:Mail>
    And you have to select MailPackage in the receiver mail adapter.
    Regards,
    Aravind

Maybe you are looking for

  • Error in JSF  - java.lang.NumberFormatException: For input string:

    Nice day friends, I am sure that this is one stupid question by newbie like me, but I already lost hope since there no many post on this error especially in JSF at Google. Here the full error I've got : executePhase(RENDER_RESPONSE 6,com.sun.faces.co

  • LiveCycle not starting correctly

    I recently deployed our first process to production and now no services will load correctly - I get an error message about Access is denied and then ClassNotFoundException.  Not sure why I am getting an access denied error, the logs do not state the

  • How to take complete an online course module

    Hi, Everyone: I just can't figure out how to complete a course module online.  After completing the module's interactive video, I leave the window open and click the button to exit.  The window with the video disappears and it goes back to the course

  • Error in Multiprovider consistency check after technical upgrade

    Hello, We have upgraded our BW system from 3.5 to 7.0 now. When I check the consistency of Multiprovider it gives me warning message that CMP Problem occurs with one of the info provider. Because I have used 0MAT_PLANT info object into my cube. I hav

  • Field Length max to 8

    Hi All, I am writing a report (not a dynpro UI) using following code selection-screen begin of block b1 with frame title block1. select-options: swcv for p_string. select-options: namespce for p_string. selection-screen end of block b1. parameters: s