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

Similar Messages

  • 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

  • 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

  • PayloadSwapBean in receiver soap adapter

    Hi experts,
    i'd like to ask whether PayloadSwapBean could be used in receiver soap adapter to swap payload to attachment?
    if not, is there any alternative to do so? please enlighten me if you have any suggestion,
    thanks.

    Or is there any other way to swap payload to attachment?
    can any one suggest me?
    thanks

  • 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

  • Filename extension in Payload Swap bean

    Hi Experts
    I have a scenario Proxy to FTPS , where I have to send an excel attachment. I have used payload swap bean in receiver channel and it is working fine as I am now able to see attachment in final destination folder however since the file name is coming from ECC and we are using dynamic configuration in PI to handle this. excel attachment is missing the extention .xls when it is being triggered from ECC and therefore in FTP folder file is getting generated but with no extention.
    I have added the extention .xls (as per the MIME header) in dynamic config and also tried to use concat function to achieve this extention to be added as final name of the file but when I did above adjustments I can see the correct name being generated in Main payload in SAP PI receiver channel monitoring but not in final destination folder, file still looks same as earlier (without any extention) , I believe since I am using payloadswapbean in module whatever I am getting in Mainpayload is being swapped by excel attachment values but not sure why the correct extention is not being shown up at final destination folders.
    Please suggest how can I get the correct file name in destination folder with the help of SAP PI, I know I can do this if ECC will add .xls in attachment name.

    Hi Mohit,
    I have tested the same scenario and it is working with PayloadSwapBean and DynamicConfiguration in the mapping and the file name correctly placed in the target.
    Receiver File CC:
    Dynamic Configuration:
    Target Directory:
    If your file name correctly set in dynamic configuration then the target file will be created correctly.
    Regards,
    Praveen.

  • 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

  • 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

  • Send attachment with receiver SOAP adapter

    Dear Guru's,
    We have created a scenario SAP ERP (ABAP Proxy) -> PI 7.0 -> (Webservice) OSB.
    In the ABAP Proxy have we attached a file (jpg). In the SXMB_MONI we see first the file (named attach), and second the MainDocument. It seem's this is the wrong sequence.
    We tried to correct this with AF_Modules/PayloadSwapBean in the receiver SOAP adapeter, but it does not work.
    There are blogs who tells about how to configure the parameters. We did it as follows:
    AF_Modules/PayloadSwapBean swap1
    AF_Modules/PayloadSwapBean swap2
    swap1:  swap.keyName = payload-name
    swap1:  swap.keyValue = attach
    swap2:  swap.keyName = payload-name
    swap2:  swap.keyValue = MainDocument
    In the communication channel audit log the swap is processed succesfully, but we don't see nothing changing in the message sequence.
    Can somebody please help me with this issue?
    Kind regard,
    Jeroen Jung

    Hi Stefan,
    The main thing at this moment is to change the sequence of the payload and attachement. PI puts the attachement first and than the payload and in that sequence the receiver application can't deal with it.
    This is a multipart related message and in the header it refers to the image (image/jpeg) first instead of the payload (application/xml).
    As you can see in the first message we have used PayloadSwap Adapter module in the receiver SOAP Communication Channel to change this sequence and in the Audit Log of the SOAP CC we can see that it does SWAP functionality succesfully but the result is the same and nothing happens.
    Here below you can see the result of a http snapper grabber:
    POST /EnterpriseContentManagement/ProxyServices/PS_EnterpriseContentManagement_v1 HTTP/1.0
    Accept: */*
    Host: localhost:8090
    User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
    CallingType: SA
    Content-Type: multipart/related; boundary=SAP_00e371ef-3ca3-11df-9503-001f2966194a_END; type="image/jpeg"; start="payload-9A6BAB4B2FE1273DE10000000A503151 @ sap.com"
    Content-Length: 939196
    SOAPACTION:
    --SAP_00e371ef-3ca3-11df-9503-001f2966194a_END
    content-id: payload-9A6BAB4B2FE1273DE10000000A503151 @ sap.com
    Content-Type: image/jpeg
    *********binary attachment data************
    --SAP_00e371ef-3ca3-11df-9503-001f2966194a_END
    content-id: payload-9B6BAB4B2FE1273DE10000000A503151 @ sap.com
    Content-Type: application/xml
    <?xml version="1.0" encoding="utf-8"?>
    *********XML Message************
    --SAP_00e371ef-3ca3-11df-9503-001f2966194a_END--
    Do you have an idea how we can switch the sequence of payload and the attachment? Or why the SWAP functionality doesn't have any result?
    Kind regards,
    Danke
    Jeroen Jung

Maybe you are looking for

  • I just updated my 3G to 5.0 and most of my apps and contacts disappeared.  THis has never happened before.  How can I get it back to where it was?

    I just updated my 3GS to 5.0 and most of my apps and contacts disappeared.  THis has never happened before through many updates.  How can I get it back to where it was? I did a restore from backup but that did not change anything. I can see my apps i

  • Can't get Encore to produce a valid DVD image

    I've got a project with about 6 menus and 7 timelines - one ~2 hour feature, and several 1-2 minute 'extras'. Menus have simple 30 second looping background videos. Nothing really special... I've set all my videos to transcode to a custom preset I cr

  • Converting IDOC messages into XML in SAP

    Dear experts, I wanted to know how one can setup that the IDOC messages in the SAP can be converted into XML file. I have a programme and have tested this seems to work, however, I need to know where exactly should i implement this, after the IDOC ha

  • Screensets implicates Crash

    Hi miteinonda, My screenset recall / copy / delete functions tend to crash Logic (estimated every 2nd function call). It is a long-term problem and I already forgot as I dont use them anymore. But every half a year I try to find a solution, and here

  • OWB10gR2 on RAC without Enterprise ETL option

    Documentation says that "Without the Enterprise ETL option, you can install the Warehouse Builder repository in a Real Applications Cluster environment for the limited purposes of executing in that environment". What means "limited" ??