Remove Attachment in Mail Adapter Module

Hi!
My problem: I get an email with an attachment which I process in an adapter module for the mail adapter. With the resulting XML I set a new payload, but the old attachment still exists.
This gets to a problem when I route the message back to the mail adapter, he adds the old attachment to the generated email. Therefore the new email has two attachments: the old one and the new one, which should only be one attachment: only the new one.
How can I remove the old attachment? I found no function which solves this problem.
Best regards,
Daniel

Hi Michal,
thanks for the link.
When I import aii_proxy_xirt.jar in my NWDS, I can import the MessageSpecifier class. But I can't get an instance of it from the classes which I can access.
The only 'documented' usages of this class I found were codings for java proxies, so I'm not sure we can use this class in an adapter module.
In this cases they get the MessageSpecifier instance from the proxy bean, so maybe we can get it from the EJB, but this doesn't work with an adapter module (or I haven't found out how )
Hmm. It is a simple problem, but it seems difficult to solve
Best regards,
Daniel
Message was edited by: Daniel Himmel

Similar Messages

  • Mail Adapter Module Problem!

    Hi All
    I m facing a problem in implementing a custom mail adapter module.
    The scenario is to set the content type based on the file type. eg: if the file being sent is a pdf then content type should be "application/pdf".
    I hope the scenario is clear, please feel free to ask for clarifications.
    awaiting your replies.
    Regards
    Kapil

    Hi All
    I am able to fetch the file name now and set the content type based on the file name. But I m not able to change the name of attachment of mail. For reference, I m pasting the code here, please suggest how to do the latter part
    try {
                         // CS_GETCHADAT START
                         cid  = moduleContext.getChannelID();
                         Channel channel = new Channel(cid);
                         // Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
                         // CS_GETCHADAT END
                        fileName = msgg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
                        Payload attachment = msgg.getAttachment("MainDocument");
                             StringTokenizer st = new StringTokenizer(fileName, ".");
                             while(st.hasMoreTokens()){
                                  extension = st.nextToken();     
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: filename " + fileName);
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: extension " + extension);
                             // create new payload
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: attchmntName " + attachment.getName().toString());
                             //provide attributes and content for the new payload
                             attachment.setName("Attachment :" + fileName);
    //                         msgg.setMessageProperty("http://sap.com/xi/XI/System/File","content-description",fileName);
                             attachment.setContentType("application/" + extension );
                             inputModuleData.setPrincipalData(msgg);

  • Receiver Mail Adapter Module Parameters

    Hello PI Experts,
    Can anyone pls provide me Mail adapter module parameter details for xml to txt file conversion. I have found a few but none of them are working, can you pls provide me some active links.
    Thanks,
    Sri

    I need MAIL Adapter module transformation parameter for converting my attachment from xml to text file -
    I have gone thro few forums and modified my comm channel, but still getting xml file as an output attachment  instead of a text file.
    Can anyone please suggest me how to change the module parameters to covert from xml file to text.
    I have added these module processing - please help.
    Processing sequence
    localejbs/AF_Modules/MessageTransformBean - Local Enterprise Bean - XML2Plain
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean - Local Enterprise Bean - Mail
    Module configuration
    XML2Plain - xml.endSeparator - 'nl'
    XML2Plain - xml.fieldNames  - Field1,Field2,Field3
    XML2Plain - xml.fieldSeparator - |                     |
    XML2Plain - Transform.Class - com.sap.aii.messaging.adapter.Conversion
    XML2Plain - Transform.ContentDisposition - attachment;filename="extract_p.txt"
    XML2Plain - Transform.ContentType - xml/plain;charset='UTF-8";name="extract_p.txt"
    XML2Plain - xml.recordsetStructure - Details
    Thanks,
    Sri

  • File attachement in mail adapter

    Hi ,
    I need to send users an error report which I have captured in the form of a file. Is it possible to attach this file as an attachement via mail adapter. I have been reading that the payload can be sent as attachment by specifying the interface namespace and interface name. But my requirement is to trigger the mail once the file has been completely written and not for every message. The reason being I could have 3000 records in the file and I dont want to send 3000 MAILS out but just 1 mail for the entire 3000 records...
    Thanks,
    Teresa

    Hi Teresa,
    I hope, I understand you right.
    When you use the file-adapter for sending the file, you can without mapping send this file out to a mail receiver as attachment, there is nothing special to do.
    Regards
    Stefan

  • Change "subject" in Receiver Mail Adapter Module

    Hi all,
    following the "How To Guide" I developed a Module for my receiver mail adapter. Everything works fine.
    Now my question: is it possible to change the content of the mail-"subject" in the module?
    Your help is appreciated.
    Carmen

    Hi Stefan,
    maybe I should describe my problem more detailed:
    My scenario is RFC-XI-Mail. I use the mail package to determine the receiver of the mail dynamically. Another thing I want to do, is to attach a file to this mail which is located on the server. So far so good.
    My problem is, that the name of the file (which I need in my adapter module) changes for every mail. So what I need is the possibility to deliver it to the adapter module.
    I found out that it is possible to read the payload. So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).
    Maybe you have another idea?
    Regards
    Carmen

  • Plain text and attachment in Mail Adapter (Receiver)

    Hello,
    we have to generate a mail in the mail-adapter with a specific text and an attachment.
    The attachment is a document in pdf-format, that is generated inside an adapter-module out of the payload-document.
    An additional text has to be added to the mail for the receiver in plain-text-format, like "Dear customer ... enclosed you will find ...".
    Is it possible to mix plain-text and attachments in the mail adapter? Does anybody know how we can do that?
    Regards,
    Thorsten

    Hi,
    yes you can do it very easily inside the adapter module
    if you're already using the adapter module then
    you can just enhance it a little bit
    you can add the pdf to the attachment section and
    leave dear customer in the standard payload
    you can even make it a little bit more dynamic
    and create a module that will take the input from
    the communication channel config (modules tab) - for example xml tag name in which you will specify
    the dear customer (or any other text) and after this
    the pdf creating can use the xml without this tag...
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Text Attachment in Mail Adapter

    Hi, I have Proxy-XI-Mail scenario.
    I want to send the mail as TEXT attachment.But the Text is coming as Mail content.
    I have having following config
    Processing Sequence
    localejbs/CreateAttachment                           Local Enterprise Bean     XML2Plain
    localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  Local Enterprise Bean mail
    Module Configuration
    XML2Plain     Transform.Class     com.sap.aii.messaging.adapter.Conversion     
    XML2Plain     Transform.ContentType     text/plain;charset=utf-8          
    XML2Plain     xml.Header1000.fieldFixedLengths     100,10,10,30,30,80,80,20,10,10,20,20,30,10,18,240,10,30,18,10
    XML2Plain     xml.Header2000.fieldFixedLengths     100,30,40,240
    XML2Plain     xml.addHeaderLine     0
    XML2Plain     xml.conversionType     StructXML2Plain
    XML2Plain     xml.recordsetStructure     Header1000,Header2000
    Please suggest some solution.
    Thanks.
    Rushikesh

    Hi,
    Refer these blogs
    http://www.sapag.co.in/SAP-XI-Mail-Adaptor-FAQ'S.html
    The specified item was not found.
    The specified item was not found.
    eMail Report as Attachment (Excel/Word)
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    and also refer these links
    http://www.riyaz.net/blog/index.php/2008/02/27/xipi-configuring-the-sender-mail-adapter/
    http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    Regards,
    Suryanarayana

  • PDF attachment in mail adapter

    Hi
    I am reading mailbox using mail adapter. But i cannot read the PDF attachment in that mail. I use "PayloadSwapBean" in the module, but it is packing the mailbody to the text file, but they is no sign of PDF attachment. How to read the attachment.
    Regards
    Andy

    Hi Anandan,
    You can use Java/ABAP proxies to do this job for you..
    Java Proxy >> will read the mail(with the attachments) with the help of Java APIs and send the message into XI ABAP Proxy >> for this you will have to first convert the attachment into a message and then you can proceed in the regular fashion.
    Not all adapters can process attachments, I'm not sure why you are having trouble with using module processor in the mail adapter. Just check if the service pack that you are using supports this feature.
    If you are on WAS 6.10 and above you can achieve this and there is an excellent weblog by Thomas Jung on this topic at
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher

  • Mail adapter module  UTF-8 to ISO-8859-1 conversion

    Hi!
    I've a problem with a mail attachment which is generated by an adapter module for the mail adapter. The content type is set to "Application/EDIFACT; charset=iso-8859-1" when I add the attachment, but the mail adapter ignores the charset-setting.
    Therefore german "umlauts" like ü are displayed in a wrong way: ü
    When I set the content, I transform it in ISO-8859-1 : attachment.setContent(edifactString.getBytes("ISO-8859-1"),"ISO-8859-1");
    When I test the result of edifactString.getBytes("ISO-8859-1"), I get the String in the right character encoding, but the mail adapter seems to "fix" the encoding
    I also tried to use the messageTransformBean, but it doesn't worked.
    Anyone knows how to solve this issue?
    Best regards,
    Daniel

    Hi all!
    I found a solution for this problem: First I used the TextPayload-Object for the Attachment which should be added. It seems that the TextPayload-Object has some bugs handling different encodings (handels only Unicode and deletes the charset=... setting from the ContentType).
    When using the Payload object for the attachment (which handles binary data), there is no conversion to Unicode, so I get my attachment as desired (but still without the charset-setting).
    Best regards,
    Daniel

  • Problem with mail adapter module in PI 7.11

    Hi,
    I modified our adapter module from PI 7.0 to be compatible with PI 7.11 SPS3. I followed the instruction in http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417300)ID1491632150DB11633962752589437606End?rid=/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa&overridelayout=true and successfully deployed the adapter module using NWDS for PI 7.1. However, I am encountering this error in the communication channel monitoring:
    Exception caught during processing mail message com.sap.aii.af.lib.mp.module.ModuleException.
    I don't see any other details in the communication channel monitoring to help me determine the cause of the problem after this error message line. In NWDS, there was no error when I excute build the project. During deployment in NWDS, it says deployment was successful. When I check in NWA, I can find that the adapter module has been deployed successfully. I even tried to re-create the whole adapter module from scrach following the documentation for the 2nd time and still I got the same error message.
    I am using java SDK 6.
    Any help or suggestion would be greatly appreciated.
    Regards,
    Elbert

    Hi,
    This problem is now solved. I am using the correct version of NWDS for PI7.1 and using java 1.6 will not cause any problem.
    The problem was caused by the source data being zipped instead of the unzipped version that my module is expecting. Furthermore, since my module comes before the mail bean, there is no details in the communication channel monitoring that the data sent was a wrong format.
    Regards,
    Elbert

  • How To Send A Text Attachment Through MAIL Adapter

    Hi Experts,
       I Did A Scenario that is  By using file adapter at the sender side and PI as a middle ware i have sent one text file to database
    Now here my question is
    I have to send the same text file which i have sent database... my using Mail Adapter
    Simply  File to Mail Scenario
    FILE         PI                MAIL
    But I have to send the same text file which i sent to database... by using mail adapter... Here all the configuration are done ... And the channels are working properly... only thing  here is..to send same text file using mail adapter..
    It will be good if  any one can explain step by step..
    Regards
    aravindh

    Hi Rajendra,
       Tanq for connecting me ... This  Blog helped me a lot ....And it is a useful answer to me..
    For this file to mail scenario we have got .txt as an attachment ... Its fine ... But her my Client is asking me to add CONTENT in the mail... Content in the sense..
    Example of content...
    Hi,
    Please find the attachment
    Regards,
    sap pi,
    They need in the form of like this...  To add content in the mail  What i have to do...DO i need to add more configurations if it is what are they...
    Please solve the issue.. It is appreciated  some one can explain me step by step or .. By sending me screen charts..
    Thanks in  advance....
    Regards
    vinay

  • Can XI Message be mapped to a flat file attachment in Mail adapter

    Hi guys,
    I have a requirement, where I have ECC system seding a XI message to XI.
    Now XI has to convert this to a flat file may be tab delimited and send this as an attachment in email using receiver mail adapter.
    I want to avoid BPM and make it simple.
    Appreciate any help on this topic.
    Regards
    Sujan

    Hi,
    Here are some mapping examples.
    /people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
    /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    /people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
    Vishal

  • Unzip attachment in Mail adapter or/ File Adapter

    Hi everyone,
    I need to get flat file from .zip attachment that comes with mail? Is it possible to get it with Mail adapter, unzip it and then make conversion? All steps in the Integration engine?
    Another option can be get .zip with File adapter, but again how to unzip it?
    Thanks,any help appriciated as I am doing my first XI project.
    Nataliya

    >
    Buffy76 wrote:
    > Thanks a lot,  guys. Unzipping is clear now.
    >
    > Prateek, it would be great if you can you point to "how-to" file or example for MessageTransformBean.
    >
    > Regards,
    >
    > Nataliya
    ref this https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05

  • Sending File as attachment using Mail adapter with naming convention

    Dear All,
    I am working on a scenario in which my sender file adapter is sending one file named 'ABC.ok' in one of the folders in application server. I have to send the same file with the same name  to one of the folders at FTP and also to my customer at his email id.
    I have used File Content onversion at the receiver side and has selected adapter specific attributes due to which the required file is getting generated at FTP folder with the same name as that of the source. But how to send the same file using the mail adapter by keeping same name as "ABC.ok". Kindly guide me out in this.
    Regards,
    NJ

    what you need to do:
    1) Select ASMA in Sender and receiver File CC...already done
    2) Using the Dynamic Config UDF get the sender file name in the field Content-Type...for this you need to have a return statement in your UDF
    3) now before pushing this file name to the Content-Type you have to append (concat)the actual type of the file content (xml, txt)
    so your entire Content-Type node will have something like text/plain; name="abc.ok"
    SAP Note has reference on how to do this:
    https://service.sap.com/sap/support/notes/856599
    From the note:
    Q: How can I set the file name of a mail attachment?
    Regards,
    Abhishek.

  • How to access attachement in mail adapter

    Hello,
    i receive mails with an xml file attached with the mail adapter. Within the integration engine i can see that the adapter creates a message with two parts in the payload "MailAttachement-1" and "MailMessage". When i configure a file writer for my message i only get the content of the "MailMessgage" part (which contains only the sender, subject, mailtext ... and not the data i need (= "MailAttachement-1")). I tried several settings within the mail adapter configuration (user Mail Package, keep Attachements) -> no success.
    How can i get access to the "MailAttachement-1" within the mapping?
    Thanks
    Peter

    Hi,
    If you want only the header data of the file (expecting you are having other data also) then it is not possible to do so without mapping. What I would suggest is to do the mapping for header and use this in ID.
    So configure two receivers one for mail and another with file. In the receiver determination for the mail you use mapping and for file you dont use mapping at all. This would resolve your issue.
    Regards,
    ---Satish

Maybe you are looking for

  • No internet connection(help please)

    I have the model---> Linksys WRT54GL Wireless-G Broadband Router As I connect the ISPs dsl cable to router the internet light doesn't turn on! Also the phone became "dead"! when i put out the ISPs dsl cable the phone is well again! The problem isn't

  • Funds management & leading Ledger

    Hi, I am working on ECC 6.0 and have define 0L as leading ledger. Now we want to go for funds management to cater to budgeting requirement. On activation of funds management, for every transaction system ask to define the leading ledger which already

  • HT4059 Can't download IBooks from Apple iStore

    When I located the free iBooks app there is no download button. I downloaded the free app from another iPad I have, but can't from this one. Any idea why the download button isn't available?

  • Highlight/shadow sliders changing back to LR3

    I just downloaded LR4 as a trial. Everything seemed to install just fine, but when I open LR4, the new whites highlights shadows blacks sliders instantly turn back to the old LR3 recovery fill light sliders....I see them for about 3 seconds and they

  • ¿Cuántas "notas" respalda ICloud desde mi IPhone?

    ¿Cuántas notas se respaldan desde el IPhone en I Cloud?