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

Similar Messages

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Dynamic  File Name for Receiver File Adapter

    Hi All,
    How can we use dynamic name for Receiver file adapter?
    Can anyone help.
    Thanks in Advance
    Chemmanz

    Hi Chemmanz,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • Dynamically pass subject via mail adapter without using mail package

    Hi,
    We have requirement to pass the Dynamic variable as Mail subject
    we can't use Mail Package as we need to capture the data from Dynamic SOAP header Data from incomming channel
    Dynamic SOAP Header variable (XHeaderName1) comming from Sender SOAP channel.
    Receiver side we need to capture that XHeaderName1 in Mail Adapter channel using ASMA and Variable transport binding so that value of XHeaderName1 should overwrite Subject under General/ Mail Atribute section.
    Could you please let me know, how to handle this requirement using module configuration?
    Also suggest the correct configuration to use ASMA and Variable transport binding.
    Regards
    Venky

    Hi Venky,
    Please have a look at the links below. They should help you.
    Configuring the Sender SOAP Adapter- https://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm
    Configuring the Receiver Mail Adapter-https://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    Adapter-Specific Message Attributes in the Message Header  -https://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/content.htm
    Regards,
    Jannus Botha

  • Dynamic attachment name in receiver mail adapter

    Hi  all,
    i am doing a receiver mail scenario (PI 7.1). my requirement is like this :
    Receiver file need to be send in receiver mail attachment and attachment name should be dynamic
    format for the attachment name should be like this
    R+value from a particular field in payload +Timestamp
    for example my file name should be like this  R001_510815021009062532.xml  
    which is     R+ 001_510815 + 021009062532 + .xml
    can anybody suggest me how to go for this requirement? is ther any UDF or should i go for adapter module developement?
    Thanks
    sandeep sharma
    Edited by: sandeep sharma on Oct 13, 2009 8:55 AM

    Hi K Fatima,
    I read your solution.I have a similar requiement but I need to send the entire output payload as an attachment,so I am using XSLT to send the payload as an attachment.
    I am creating the file name through dynamic configuration in XSLT but the name of attachment is not as required but its any random generated name:
    *code used:*
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" />
    <xsl:output indent="yes" />
    <xsl:param name="inputparam"/>
    <!-- mail parameters -->
    <xsl:template match="*">
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
    <xsl:variable name="new-value" select="Shipment/InternalShipmentNum"/>
    <Subject>Mail</Subject>
    <From>xyz</From>
    <To>abc</To>
    <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="new-value"    
            select="concat($dynamic-value, 'subfolder\')" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
    <!--Content type -->
    <Content_Type>application/xml</Content_Type>
    <!Content Description>
    <Content_Disposition>attachment;filename "<xsl:copy-of select="$new-value"/>"</Content_Disposition>
    <!--Content Disposition -->
    <Content_Description><xsl:copy-of select="$new-value"/></Content_Description>
    <Content>
    <xsl:copy-of select=".">
    <xsl:apply-templates/>
    </xsl:copy-of>
    </Content>
    </ns:Mail>
    </xsl:template>
    </xsl:stylesheet>
    Please suggest ! I need the value in "Shipment/InternalShipmentNum" as name of attachment.
    Thanks in advance!
    Indu Khurana

  • Dynamic attachment name in receiver mail adapter for 1 attachment?

    Hi,
    seems to be a tricky thing....
    The sender interface (file) picks up an xml file and a pdf document.
    The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
    We are following this thread:
    "Sending multiple attachments winthin a single Receiver Mail adapter in required format".
    So far we are able to generate the txt file and send it together with the pdf to the recipient.
    The txt file gets its name from the payload of the xml file.
    Unfortunately the pdf should be renamed to the same name as the txt file.
    And here we are stuck.
    We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
    But for the pdf we are only able to set a static name in the channel module page using
    Transform.ContentDisposition.
    Any ideas how to solve this are really welcome!!!!
    (Solutions that do not talk about using a new module to be written are prefered.)
    Regards
    Dirk

    Hi,
    seems to be a tricky thing....
    The sender interface (file) picks up an xml file and a pdf document.
    The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
    We are following this thread:
    "Sending multiple attachments winthin a single Receiver Mail adapter in required format".
    So far we are able to generate the txt file and send it together with the pdf to the recipient.
    The txt file gets its name from the payload of the xml file.
    Unfortunately the pdf should be renamed to the same name as the txt file.
    And here we are stuck.
    We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
    But for the pdf we are only able to set a static name in the channel module page using
    Transform.ContentDisposition.
    Any ideas how to solve this are really welcome!!!!
    (Solutions that do not talk about using a new module to be written are prefered.)
    Regards
    Dirk

  • Setting dynamic file name in Receiver file adapter - not from payload

    Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
    Please let me know if you remember this.
    Thanks a lot,
    Viktor Varga

    also u can check in
    <a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
    <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>

  • Dynamic File name in Receiver File adapter

    Hi,
    My Scenario is Proxy to File.
    I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
    How can i create a dynamic filename? i searched the forum, but i could not get the correct answer,
    Please help me out.
    Regards
    Srinivas

    Hi Srinivas,
    > My Scenario is Proxy to File.
    > I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
    public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
    DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String MyFileName = sono + div + "<filename>"+".xml";
    conf.put(key, MyFileName);
    return MyFileName;
    File name you can format according to your requirement.
    And one more thing for this you have to specify the ASMA properties. For this check the below link step-1 and step-2.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards
    Ramesh

  • Error in mail adapter whilst using 'mail package' option

    Hello,
    I am using receiver mail adapter. Its working fine when I do not use 'mail package option'. But when I use mail package option, this error comes in
    Message processing failed. Cause: com.sap.aii.af.modules.conversion.xml2plain.ConversionException: No data is allowed on this structure level (2) at XML element Mail,Subject
    This is the sample of payload:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Subject>Data Update to  Portal failed</Subject>
      <From>sender email id/From>
      <To>receiver email id/To>
      <Reply_To />
      <Content_Type>text/plain</Content_Type>
      <Content>Error: Undefined Error</Content>
      </ns1:Mail>
    Any idea what should I do to get it working. Alternatively, is it possible to use the dynamic value into the email 'TO' field.
    Thanks in adavance

    Hi All,
    I need the same info in my requirement . The Scenario is MAIL > FILE . THe Vendor sends the email with  Invoices ( An Attachment) to a mail server and the attachment has to be moved to the network folder (File )
    Here , I used  IMAP4 Protocol in MAil Sender CC
    I wanted to know is it  required to use :localejbs/ AF_Modules/PayloadSwapBean and any module configuration to petch the attachment  ?

  • Dynamic directory name in Receiving File adapter

    Hi,
    In File to File senario, In receiving system i want to create directory name dynamically. In my mapping there is a field called name, the directory name in the receiving system will be value in the name field. Any one can help me how to do this one...
    Thanks
    Rao

    Hello,
    Please follow the below to achieve the same.
    input - Store number,
    UDF
    String dynaname = input;
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,dynaname);
    return "";
    UDF mapping
    Source[input]   -
    > UDF -->    Rootnode of target structure.           
    Hope it helps.
    best regards,
    raj.

  • TS3276 I receive a pop up from ICal saying the server does not recognize me user name and password.  This started yesterday.  I have no problems with receiving or sending emails through Mail

    I receive a pop-up from ICal saying the server does not recognize my user name and password for my me.com email address.  This started yesterday and occurs about every 5 minutes or so.  There are no problems with receiving or sending email through Mail.  I did change me email password several days ago but have no problems sending/receiving since then.

    I fixed the problem.  I opened Preferences in ICal and entered my new password.  No more pop-ups

  • Sending plain request to web service using receiver sender adapter and PI and expecting as attachment as response

    Hi
    In my scenario,we are sending plain request to web service using receiver sender adapter and PI will receive response as excel attachment. What are standard module required to achieve this and sequence? or checking Keep attachment box will help us to achieve this? 
    is it possible to receive excel sheet as attachment from receiver soap adapter ?
    Thanks in Advance

    Hi,
    This issue might be due to the invalid .pem certificate file.
    Make sure to include the beginning and end tags on each certificate.                   
    The result should look like this:                
    -----BEGIN CERTIFICATE-----
    (Your Primary SSL certificate: your_domain_name.crt)
    -----END CERTIFICATE-----
    -----BEGIN CERTIFICATE-----
    (Your Intermediate certificate: DigiCertCA.crt)
    -----END CERTIFICATE-----
    For more detailed information, you could refer to:
    https://www.digicert.com/ssl-support/pem-ssl-creation.htm
    Regards

  • Mail Adapter - Multiple mail ID and multiple mail servers config.

    Hi All
    I am doing BPM synch scenario in which i get the response from SAP box and send the response via email adapter. I am using mail.xsd and doing mail config. in message mapping. However in the TO field i am able to give only one email ID. If i give multiple email ID's mail is not received. I tried comma and semi-colon as separator. Still not working? I have two questions in configuring TO option:
    1) How to send to multiple id's? I am using Lotus Notes.
    2)How to send to multiple mail servers? I have to send to Lotus Notes id's and outlook express id's also simultaneously.
    Thanks for your help in advance
    Warm Regards
    Samuel

    Hi,
    Please find here with some observations about it,
    1) How to send to multiple id's? I am using Lotus Notes.
    If you have specified an IMAP server under URL, the message is saved in the specified folder but is not sent to the receiver specified under To.
    Then even if Under To, you had specified the e-mail address that will receive the message would be separated with a semicolon. It will not work.
    Please verify about it .
    The below link will also help you to verify if there is anything missing
    Mail Adapter (XI) - how to implement dynamic mail address
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    BPM:Single Sender and Multiple Receivers based on synchronous
    exchange(switch) part-1
    /people/prasadbabu.nemalikanti3/blog/2006/03/10/bpmsingle-sender-and-multiple-receivers-based-on-synchronous-exchangeswitch-part-1
    Generic Message Interface in SAP Exchange Infrastructure Email Integration Scenarios
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00d5a235-4803-2a10-f682-889d67c69975
    (If your using Alert Framework then)
    If you want to send it to multiple email addresses and all email addresses are user of XI then you can define "Role" and attach that role to everyuser and make this role as receipent of alert .
    Thanks
    Swarup
    Thanks
    Swarup

  • Dynamic file name in receiver channal

    Hi, All,
    I would like to set dynamic file name in receiver channal. My xml payload will be like this:
    <file_name>file1.txt</file_name>
    <text_content>balabala......</text_content>
    I would like to output an text file which text content will be the value of <text_content>, file name will be the value of <file_name> in the xml payload.
    Is there anyone could help me?
    Helpful answer will be surely awarded. Thanks
    Yang

    Please look at the below description from help.sap.com. You can use the below steps to name the file from a value in the payload. You would have to use File Content Conversion to insert the value of the <text_content> in the file.
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    ●      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    ○       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    ○       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    Thanks
    Praveen M

  • Dynamic queue name with JMS Queue XML?

    Hi,
    Is it possible to use dynamic queue name with JMS Queue XML?
    I tried using a variable in the JNDI URL, and supply the value in a package. I specified the following in the JNDI URL in the Topology:
    e.g.
    <JMS_RESOURCE>?d=<DTD_FILE>&s=<SCHEMA>&JMS_DESTINATION=#PROJECT_NAME.dest_var
    I declared and set the variable in a package, then tried to load data from the above data server to database. But executing this package gave me the following error:
    7000 : null : java.sql.SQLException: javax.jms.JMSException: Cannot find the target in JNDI (#PROJECT_NAME.dest_var)
    java.sql.SQLException: javax.jms.JMSException: Cannot find the target in JNDI (#PROJECT_NAME.dest_var)
         at com.sunopsis.jdbc.driver.bg.executeQuery(bg.java)
         at com.sunopsis.jdbc.driver.bh.executeQuery(bh.java)
         at com.sunopsis.jdbc.driver.l.f(l.java)
         at com.sunopsis.jdbc.driver.l.executeUpdate(l.java)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Am I doing it wrongly?
    Thanks!

    hi,
    as it's not in Adapter-Specific Message Properties
    http://help.sap.com/saphelp_nw04/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/content.htm
    looks like you cannot do it with jms adapter in standard
    use proxy or your own adapter instead
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Maybe you are looking for