Handling multiple xls , xlsx attachments in mail adapter

We have a (sender)mail with excel attachment scenario which is converted to an Idoc.
Currently we are using ''PayloadSwapBean" for converting .xls attachment as main payload which is being read using an adapter module.
PFA the screenshot.
We have a new requirement as below
when there are additional attachments in e-mail only the relevant template (MS Excel file) loaded.
Handle all MS Excel format: .XLSX in addition to existing .XLS
ability to process multiple excel file in a mail
Kindly suggest ways to handle it.
Regards,
Kesava

Could you please provide the location of  PayloadSwapBean file (.Ear,.jar,.class and also provide AL11) Transaction  in PI 7.31.
Brief Background:
We have a requirement to read multiple attachment from mail adapter. PayloadSwapBean is capable of reading only single attachment. We would like to see the code of PayloadSwapBean and modify accordingly to meet the requirement.
If there is any alternative could please suggest the solution for read the multiple attachments in sender mail adapter.

Similar Messages

  • Query related to multiple attachments in mail adapter

    Hi,
    I have a query related to multiple attachments in receiver mail adapter.
    I have successfully configured mail related scenarios but now I have another requirement in which I have multiple source files in one directory and I want to send one mail for multiple files as mail attachment using receiver mail adapter. Can anybody help me how to achieve multiple attachments in reciever mail adapter.
    To clarify the requirement more let us take an example
    Ex: I have 5 input files in the source which I pick up using additional files option in the sender file adapter, now I want to send those 5 files into one mail with 5 attachments. Can anybody explain how 5 different payload will be sent as multiple attachments in one mail.
    For your information I used, options like "keep attachments" , some parameters in module processesors etcs...but not able to find out as how exactly it will be achieved.......I dont want to use BPM collect pattern for this.....
    Need your help on this issue. Please suggest the solution as how it can be achieved using receiver mail adapter.
    Thanks & Regards
    Prabhat

    Hi,
    I resolved the issue on my own. Thanks for your help and support.
    Thanks & Regards
    Prabhat

  • Different Attachment extension(.xls,.txt) in sender mail adapter

    Hi Experts
    Is it possible to use different type of attachment extension (e.g .xls,.txt) in the sender mail adapter?
    My requirement is , the attachment in the mail adapter will be used as the main payload.So I am using PayloadSwapBean adapter module.
    Currently I am using the following module key for .xls attachment and it is working.Configuration for .xls attachment is as follows
    swap.keyName-Content-Disposition
    swap.keyname-Content-Description
    swap.keyName-Content-Type
    swap.keyValue-attachment;filename="MailAttachment-1.xls"
    swap.keyValue-MailAttachment-1
    swap.keyValue-application/vnd.ms-excel.
    Now, the attachment may be .xls or .txt file.
    Now If I want to use .txt atachment then do I need to define all these parameter again and in that case what will be my content type for .txt file.
    Your inputs required
    thanks
    Ayan

    PayloadSwapBean  will only convert the attachment as the main payload.
    Yeah for reading excel file I have a separate custom adapter module.This is not in the scope of my question..
    All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.
    If that is possible what will be my content-type for .txt or can I remove content-type and use only content-disposition and content-description so that any type of attachment it can recognise.
    The momment I am specifying  content-type , I am making it particular  that only say .xls attachment , it will identify.
    I hope I make you clear.Inputs required
    Thanks
    Ayan

  • Attaching multiple windows friendly attachments in Mail

    I am able to attach a single file to a piece of outgoing mail in Mail, and have that file appear as an attachment that I can open up in Outlook.  However, if I select multiple files to attach to a piece of mail and the "windows friendly attachment" option is checked, those attachments show up embedded in the Outlook mail and not as separate attachments.
    How can I send multiple windows friendly attachments in a single piece of mail and have them show up as separate attachments in outlook?

    I seem to have solved this problem, which was that my daughter (on Windows) could not save attachments that I sent her in emails, and had other problems.
    My solution is:
    1. Mail > Edit >Attachments: Check "Always insert attachments at end of message".
    2. After composing the text of a message in Mail, drag your image or its icon on to Mail's window and drop the icon at the end of the message. Voila (for me at least). If you drop the image icon at the top of the text, the image gets transmitted but not the text (!!!) (Ain't Apple wonderful!).
    3. My daughter sees the image, opened, at the bottom of the message and by Right-Clicking on it she can save the image (she typed .jpg after the image title and got a jpg.)
    Hope this works for you.

  • Attachments for mail adapter?

    Hello everybody,
    I've seen that XI 3.0 provides a file adapter. Has anyone experiences with this adapter? I'm looking for information if it's possible to send and receive the XML message content as attachment.
    Thanks in advance
    Björn

    Hi Mohit,
    Follow this blog for the ID configuration:
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4383
    Create Receiver Determination and Interface Determination as described, and add a sender file CC and receiver mail CC according to your needs, plus sender and receiver agreements.
    In order to maintain the original file names, use a simple adapter module with the code mentioned here:
    http://forums.sdn.sap.com/thread.jspa?threadID=2122711&start=14
    Hope this helps,
    Greg

  • Mail Adapter - Attachments

    How to get Mail Attachments using "Mail Adapter" in XI?
    I will receive email with some files (with defined format). I need to put the data of file in a RFC.
    When I use "Mail Adapter", the XI send the attachments to XML?

    Hi,
      Extremely sorry, the links are,
    /people/pere.diaz/blog/2005/07/14/broadcasting-reports-via-mail-with-pdf-attachment
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Please ignore the previous post, sorry again.
    Anirban.

  • How to handle multiple attachments in XI mail sender adapter?

    Hi,
    is it possible to handle multiple attachments in a mail receiving in XI?
    Our customer wants to send us mails with multiple attachments and we have to convert each attachment to an idoc.
    But as I know XI (receiving mails) can handle only a single attachment in a mail. Is it true?
    Any ideas?
    Thanks a lot!
    Regards
    Wolfgang

    Hi Wolfgang,
    Well, although I have never tried a scenario of picking more than two attachments from one mail, I wonder if its possible in the first place!
    Here are the reasons why I think it is possible:-
    It is not mentioned anywhere in the SAP Notes for mail adapter that it is not possible.
    *It is not mentioned anywhere in the SAP help documentation that it is not possible
    *Also, I think if the receiver mail adapter can create more than one attachment, the sender should be able to pick more than one!:)
    Have you tried defining a PayloadSwapBean module to pick up more than one attachment?
    Just try experimenting with this particular part of the module code:-
    Content-Disposition: attachment;filename="MailAttachment-1.xml"
    Content-Description: MailAttachment-1
    I think even the following weblog might be able to help you to a certain extent:-
    "Receiving E-Mail and processing it with ABAP - Version 610 and Higher" - /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    Regards,
    Sushumna
    Regards,
    Sushumna

  • How to handle Multiple attachments in sender Mail Adapter

    Hi,
         In our requirement is mutiple documents send through mail adapter, In custom java module we read the each document details and do it bussiness process. But now i am not able to read the multiple files at a time. we are able to read single file only. So plz give the solution for that.
    1) How to send multiple attachments(like word, PDF, JPG etc..) using mail apapter.
    2) How to read multiple attachments in custom java module.
    Thanks & Regards
    Vijay

    Hi Vijay,
    Go through this weblog this explains steps to multile attachments.
    /people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
    Regards,
    Ashwin.

  • Sender Mail Adapter Configuration - Process Multiple Attachments

    Dear sirs,
    I need to process several attachments at the same mail message as individual payloads.
    In default configuration of sender mail adapter only the body of message is used as payload.
    So I added PayloadSwapBean Module at Processing Sequence and it processed the attachment I set in Module Configuration.  I'm not able to process all attachments available, just one attachment is sent to PI pipeline.
    How can I process all attachments of a single mail message?
    Thank you in advance.
    Fabio Purcino

    Hi Jose,
    We are trying to implement reading multiple attachment in sender mail adapter. 
    Our Requirement is : Reading a mail having multiple .xls files. This should be read and converted to payload .
    package multiswap;
    //import com.sap.aii.adapter.xi.ms.XIMessage;
    import com.sap.aii.af.lib.mp.module.*;
    import com.sap.aii.af.lib.trace.Trace;
    import com.sap.aii.af.sdk.xi.mo.Message;
    import com.sap.aii.af.sdk.xi.mo.MessageContext;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBMessageOperator;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload;
    import com.sap.aii.af.sdk.xi.util.PayloadType;
    import com.sap.aii.af.service.auditlog.Audit;
    import com.sap.aii.af.service.cpa.*;
    import com.sap.engine.interfaces.messaging.api.MessageDirection;
    import com.sap.engine.interfaces.messaging.api.MessageKey;
    import com.sap.engine.interfaces.messaging.api.Payload;
    import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.ejb.*;
    public class MultiSwapRead
        implements SessionBean, Module
        private static final String VERSION_ID = "$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final Trace TRACE = new Trace("$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final String SIGNATURE_PROCESS = "process(ModuleContext , ModuleData)";
        protected Hashtable cachedChannels;
        protected SessionContext myContext;
        public MultiSwapRead()
            cachedChannels = new Hashtable();
        public void ejbRemove()
        public void ejbActivate()
        public void ejbPassivate()
        public void setSessionContext(SessionContext context)
            myContext = context;
        public void ejbCreate()
            throws CreateException
        public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
            throws ModuleException
            if(TRACE.beLogged(200))
                TRACE.entering("process(ModuleContext , ModuleData)", new Object[] {
                    moduleContext, inputModuleData
            ModuleData outputModuleData;
            Iterator itr;
            outputModuleData = inputModuleData;
            String chid = moduleContext.getChannelID();
            TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, (new StringBuilder()).append("performing payload swap for channel ").append(chid).toString());
            LookupManager lman = LookupManager.getInstance();
            Channel chan = null;
      try {
      chan = (Channel)LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, chid);
      } catch (CPAObjectNotFoundException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      } catch (CPAException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
            Direction direction = chan.getDirection();
            String swapkey = moduleContext.getContextData("swap.keyName");
            String keyvalue = moduleContext.getContextData("swap.keyValue");
            Object obj = inputModuleData.getPrincipalData();
            Object pivotedObj = inputModuleData.getSupplementalData("mp.pivoted");
            boolean pivoted = pivotedObj == null || !(pivotedObj instanceof Boolean) ? false : ((Boolean)pivotedObj).booleanValue();
            Message mo = null;
            if(obj instanceof com.sap.engine.interfaces.messaging.api.Message)
                mo = (Message)((com.sap.engine.interfaces.messaging.api.Message)obj);
            } else
            if(obj instanceof MessageContext)
                mo = ((MessageContext)obj).getMessage();
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no message found");
            if(mo != null && XMBMessageOperator.numberOfPayloads(mo) > 0)
               // String midstr = XMBMessageOperator.getMessageId(mo).toString();
                MessageKey auditkey = new MessageKey(((com.sap.engine.interfaces.messaging.api.Message) mo).getMessageId(), com.sap.engine.interfaces.messaging.api.MessageDirection.INBOUND);
                itr = (Iterator) mo.getAttachments();
                if(swapkey != null && keyvalue != null)
                    StringBuffer textSwappingbyBuf = new StringBuffer();
                    textSwappingbyBuf.append("Swap: swapping by '").append(swapkey).append("' ? '").append(keyvalue).append("'");
                    String textSwappingby = textSwappingbyBuf.toString();
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textSwappingby);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, textSwappingby);
                   while (itr.hasNext()){
                    boolean swappedp = swapPayloads(mo, swapkey, keyvalue);
                    String swappedStatus = swappedp ? "Swap: successfully swapped" : "Swap: no matching payload found";
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, swappedStatus);
                } else
                    StringBuffer textInvalidBuf = new StringBuffer();
                    textInvalidBuf.append("Swap: parameter missing ");
                    if(swapkey == null)
                        textInvalidBuf.append("swap.keyName");
                    if(swapkey == null && keyvalue == null)
                        textInvalidBuf.append(" and ");
                    if(keyvalue == null)
                        textInvalidBuf.append("swap.keyValue");
                    String textInvalid = textInvalidBuf.toString();
                    TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textInvalid);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.WARNING, textInvalid);
            } else
                String messageEmpty = "Swap: message is empty or has no payload";
                TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, messageEmpty);
            return outputModuleData;
        private static boolean swapPayloads(Message mo, String swapkey, String keyvalue)
            swapkey = swapkey.toUpperCase(Locale.ENGLISH);
            keyvalue = keyvalue.toUpperCase(Locale.ENGLISH);
            int ifound = -1;
            for(int i = 0; i < XMBMessageOperator.numberOfPayloads(mo); i++)
                XMBPayload pldi = XMBMessageOperator.getPayload(mo, i);
                String pldivalue = null;
                if(swapkey.equals("PAYLOAD-DESCRIPTION"))
                    pldivalue = pldi.getPayloadDescription();
                } else
                if(swapkey.equals("PAYLOAD-NAME"))
                    pldivalue = pldi.getPayloadName();
                } else
                    pldivalue = pldi.getContentAttribute(swapkey);
                if(pldivalue == null)
                    continue;
                pldivalue = pldivalue.toUpperCase(Locale.ENGLISH);
                if(pldivalue.indexOf(keyvalue) < 0)
                    continue;
                ifound = i;
                break;
            if(ifound >= 0)
                XMBPayload pldfound = XMBMessageOperator.getPayload(mo, ifound);
                if(pldfound.getPayloadType() != PayloadType.APPLICATION)
                    XMBPayload pldapp = XMBMessageOperator.getApplicationPayload(mo);
                    if(pldapp == null)
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    } else
                        pldapp.setPayloadType(PayloadType.APPLICATION_ATTACHMENT);
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "successfully swapped");
                return true;
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no matching found");
                return false;
    We couldn't go further. Please have a look in highlighted code.
    Regards,
    Kesava.

  • Read multi-tabbed excel file attachments from Sender Mail Adapter.

    There is a need to read excel attachments from incoming email to a
    mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
    or .csv attachments.
    For excel attachments we know from SDN that you have to write
    adapter modules to handle excel. However the excel file we need to read has
    multiple worksheets(tabs) and data may be contained in any of them.
    Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
    Thanks,
    Rudra

    Rudra,
    Use Java Mapping.  There is a free java api available called JExcelAPI to achieve this. 
    Shabarish's blog describes about this.  This might be helpful to you
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives

  • Mail Adapter to Soap Adapter keeping the attachments - How?

    Hi guys,
    I am working on a scenario where I should pull emails from an Exchange server and I should forward them (with their attachments) to a separate systems via a Web Service.
    So far I have been able to pull the emails using the Mail Adapter and I get to see them in the monitoring tool of PI with their attachment(s).  But what I am not sure of is how I should forward these emails to the external system using a web service.
    This system should expose this web service that should use something similar to SOAP with attachments (I guess) and then PI should forward these attachments using the receiver SOAP adapter with the "keep attachments" option selected.
    Is this something that could work as simply as this (by configuring these two adapters to keep their attachments) OR will I need to do some more fancy stuff?
    Thanks for any advice you can give me on this.
    Aldo

    Hi Stefan,
    thanks for your replay.
    Yes, I understand that the mail should be in an XML message.  And with that part we are doing OK.  We have managed to send the XML between the systems.
    However, what I don't understand is how to pass the attachments.
    How should the receiving system receive them?  if they are not in the XML message itself how are these going to be passed over?
    Will the SOAP envelop have some kind of link or reference to the attachments?
    The receiving system is a SAP CE system and it's based on Java.  Can they expose a service that will somehow handle these attachments?
    Could you explain this part to us?  this is where we get confused.
    Thanks for your help in advance,
    Aldo

  • Sender ebXML Adapter for handling multiple documents

    Hi all,
    I would like to ask for input on how to implement the use of sender Seeburger ebXML channel that will send multiple documents types (CIDX ordercreate and CIDX orderchange).
    For Seeburger AS2 adapter, handling of ANSI X12 documents (EDI850 and EDI860) can be done using Generic AS2 sender and Split997 adapters, and message splitter configuration. Is there same functionality that can be used for sender Seeburger ebXML adapter for handling multiple non-ANSI X12/EDIFACT documents like CIDX OrderCreate and CIDX OrderChange?
    Thanks,
    Edward

    Hi,
    Can we hit 100 Email ids to read email using single mail adapter?
    no, you have to configure url / authentification in the adapter what is obviously different for different ids.
    Can we achieve it using standard module?
    Do we need to develop custom module to read emails from 100 mail ids?
    You don't need module, you need 100 sender channels.
    /Udo

  • Excel file(.xls) as attachment and Body(Signature) via Receiver Mail Adapter

    Hi PI Experts,
    I have a requirement File(.txt) - PI(7.4) - mail (.xls attachment and signature in the body). Can anyone pls help me with the best approach to send excel file as mail attachment and signature in the body.
    Thanks,
    Sri

    Hi
    You can try this approach
    1. use mail package and java mapping to populate the mail package.
    inside the java mapping do the following
    a. read the text file and convert it to excel and then set it as additional attachment.
    b. map the signature and body with the field 'content' of mail package.
    2. on the receiver mail adapter check both mail package and keep attachment options.
    Hopefully this will work.
    Reference links
    excel write : Excel and Java - Read and Write Excel with Java - Tutorial
    set attachment: How to save MainDocument as additonal attachment in sender channel?

  • Receiver mail adapter configuration for e-mail attachments

    Hi ,
    I need to send two files from sender file adapter to receiver mail adapter as e mail attachment.
    I want same attachment name in email as on sender side on FTP location.
    This is by pass scenario no object created in ESR.Please suggest how to handle this.
    For example if file name test.txt is send by file adapter then on mail  attachment name should be test.txt
    Thanks
    Mohit
    Edited by: Mohit Verma on Feb 10, 2012 4:18 PM

    Hi Mohit,
    Follow this blog for the ID configuration:
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4383
    Create Receiver Determination and Interface Determination as described, and add a sender file CC and receiver mail CC according to your needs, plus sender and receiver agreements.
    In order to maintain the original file names, use a simple adapter module with the code mentioned here:
    http://forums.sdn.sap.com/thread.jspa?threadID=2122711&start=14
    Hope this helps,
    Greg

  • Receiver mail Adapter Rename Attachments

    Hi Experts,
    In an Proxy --> XI --> Mail scenario, how do I configure the Mail Receiver Adapter to rename attachments?
    There is a PDF file and a DOC file that the Proxy is sendign to PI and I can see them in the payload with filenames file1.pdf and file2.doc
    How do I configure the Mail receiver adapter to send them as attachments retaining the same filenames? Can I atleast assign any other name to the files?
    Any method other than writing own Adapter Module?
    Regards,
    Shobhit

    Hi Shobhit
    If the attachment name is not dynamic (like timestamp) etc then you can use MessageTransformBean to change the attachment name at Mail adapter level.
    Transform.ContentDisposition attachment;filename ="yourfilename.extension"
    Transform.ContentDescription  attachment name
    Transform.ContentType  your type like text/plain or application/pdf.
    If you are using Mail package then you can  set the attachment name from mapping itself.(here even Timestamp and Dynamic values work)
    Thanks
    Gaurav

Maybe you are looking for

  • Issue facing while opening a Canvas application in Webstart

    Hi experts, Need a help on the issue: issue was like this: I have created a Canvas application in Swings. And It was running fine. The next day i have compiled again the code and build the class and after jar. Deployed in Tomcat. Started the webstart

  • IPOD NOT APPEARING IN "MY COMPUTER" OR ITUNES

    Hey guys, just wondering if you can help me, all of a sudden when i connect my touch to my windows laptop, the sound when u plug ur ipod appears however it doesnt appear on "my computer" or in itunes. If you guys have any ideas why this is happening

  • Event not showing up in editor but appears in package contents

    I have a weird scenario where one of my events is not showing up in a library. I have a simple library with the following events: Interviews B Roll Edits When I open final cut, I only see the B-Roll and Interviews event. The Edits one is missing. Whe

  • VOLUME and SPEAKER PHONE

    I had to return my 8GB Iphone yesterday as the volume on the handset and speaker phone was absolutely poor! I need my phone for BUSINESS and not being able to hear is a large issue for me. The Apple salespeople at the store tried to keep me quiet and

  • I tried to apply the Call of Duty: Advanced Warfare Promotion today at Best Buy...

    Well today I had another unfortunate experience at Best Buy.  I tried to use the below deal that begins today: Trade in Call of Duty: Ghosts for Xbox One or PS4 and receive $20 trade-in value. Trade in Call of Duty: Ghosts for Xbox 360 or PS3 and rec