Variable file name through Receiver mail Communication channel

I need to send a file through receiver communication channel   with the following name ( YYMMDD schema)  . The YYMMDD is current date .  I know how to create these file names throug FCC ( file communication channel) , I tried in the same manner to create this file through Receiver Mail CC , but it did not work  .  If you have any ideas , can you please share with me ?
ABC_MMYYDD.TXT
Thanks.
Ritvik

Hi Ritvik,
Also, Please look at this link and see if it helps you. It is generating variable file name through a UDF
Re: Problem in dynamically file name generation procedure
Best Regards

Similar Messages

  • Dynamic name for attachment in the Receiver Mail Communication Channel

    Hi All,
    I want to dynamically set the name of attachment in receiver mail Communication Channel.
    Example: IN__9907211000004_4048454000005_20081211_01000000002643
    The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
    20081211 this is the date and
    And againg this number 01000000002643 is read from message.
    What is the procedure to create Adapter Module? I am new to Adapter Module.
    Any Ideas ideas?
    Thank You,
    Mukhtar

    Hi Michal,
    I had a look to your blog and tried to modify according to my requirement.
    Here is the code
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.mp.module.*;
    import com.sap.aii.af.ra.ms.api.*;
    @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
    @stateless
    public class SetAttachmentName implements SessionBean, Module{
         private SessionContext myContext;
         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{
         try {
    Message msg = (Message) moduleData.getPrincipalData();
    //creating parsable XML document
    InputStream XIStreamData = null;          
    XMLPayload xmlpayload = msg.getDocument();
    XIStreamData = xmlpayload.getInputStream();
    DocumentBuilderFactory  docBuilderFactory = DocumentBuilderFactory.newInstance();               
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(XIStreamData);
    //finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
    String SenderIDTag = null;
    SenderIDTag = moduleContext.getContextData("SenderIDTag");
    //finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
    Element element = doc.getDocumentElement();     
    NodeList list = doc.getElementsByTagName(SenderIDTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    String anIDTag = null;
    ReceiverIDTag = moduleContext.getContextData("ReceiverIDTag");     
    element = doc.getDocumentElement();     
    list = doc.getElementsByTagName(ReceiverIDTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    Date date= new Date(System.currentTimeMillis());
    //Add date to the Message
    SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMdd");
    mailFileName += "_" + dateFormat.format(date);
    String BillNrTag = null;
    BillNrTag = moduleContext.getContextData("BillNrTag");     
    element = doc.getDocumentElement();     
    list = doc.getElementsByTagName(BillNrTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    //creating the attachment
    byte by[] =  xmlpayload.getText().getBytes();
    XMLPayload attachmentXML = msg.createXMLPayload();
    attachmentXML.setName(mailFileName);
    attachmentXML.setContentType("text/pdf");
    attachmentXML.setContent(by);
    //adding the message to the attachment
    msg.addAttachment(attachmentXML);
            inputModuleData.setPrincipalData(msg);
        } catch (Exception e) {
            throw new ModuleException(e);
        return inputModuleData;
    I hope this is right Adapter Module coe for my requirement.
    Thank you in Advance,
    Mukhtar

  • How to keep same sender file name for receiver mail attachement

    Hi,
      i am working with File to Mail scanario. There i want to pick a flat file from native file system and then send it as email attachment. Now i am able to send the file but the flat is getting converted as an xml file. is there any method to keep the same sender file name and type for receiver mail attachment. i am not using any mail package. i am using XI payload and keep attachments.
    Thanks in advance.
    -Siva

    Hi,
    Yes,With out using the mail package u can send the Mail Attachments to the receiver side,
    In that case no need of Integration Repository objects.
    Chck this links.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    If u dont get ur requirement then let me know ur Mail id i will send u a Doc.
    Regards,
    Phani
    Reward points if Helpful

  • How can i get message id as file name in Receiver Mail Adapter

    Hi All,
               We are working on file to mail scenario. Client requirement is " Attached file name should be the message id" How can we achieve this.
    Thanks & Regards,
    Purshothamm

    Hi,
    To have the file name as message id, I think the below blogs can help you…
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    Regards,
    Vijay N

  • Not renaming attachment xml file name in receiver mail adapter

    Hi,
    I receive SOAP from GRC and need send to Partner an email.
    I have  SOAP to MAIL scenario where an xml file is picked up and transformed and zipped into the target format in XI which has to be sent as an attachement in an email on the receiver side.
    I am getting the mail with the attachement. But I would like to rename the attachment as the name "NFE.XML" and the ZIP File as the name "nfe.zip"
    I am using MAIL adapter with Modules above.
    Number  Module Name                                                                          Module Type                       Module Key
    1             AF_Modules/PayloadSwapBean                                           Local Enterprise Bean        Transform
    2             AF_Modules/MessageTransformBean                                  Local Enterprise Bean        ContentType
    3             AF_Modules/PayloadZipBean                                                Local Enterprise Bean        zip
    4             sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean    Local Enterprise Bean        mail
    Module Configuration :
    Module Key                           Parameter Name                Parameter Value
    Transform                             swap.keyName                 payload-name
    Transform                             swap.keyValue                 NFE
    ContentType                         Transform.ContentType    application/xml; name="NFe.xml"
    zip                                         zip.filenameKey                ContentType
    zip                                         zip.mode                           zip
    I  am using transport protocol  "XIPAYLOAD" and set  "KEEP ATTACHMENTS"
    I have with result example above :
    Name from ZIP              :  PayloadName.zipu200E(4KB)u200E
    Name from attachment :  PayloadName
    Regards,
    Ricardo

    Hi Shobhit,
    The module tab of your mail adapter will look like this.
    Processing Sequence
    Module Name                                                            Type                                      Module Key
    localejbs/AF_Modules/MessageTransformBean   rename LocalEnterpriseBean     
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  mail     Local EnterpriseBean     
    Module Configuration
       Module Key               Parameter Name             Parameter Value
          rename      Transform.ContentDescription                      File
          rename  Transform.ContentDescription  attachement;filename="yourfilename.ext"                                                          
          rename            Transform.ContentType                 application/text;name="yourfilename.ext"
    Thanks
    Amitanshu

  • Renaming attachment file name in receiver mail adapter

    Experts,
    I have a file to mail scenario where an xml file is picked up and transformed into the target format in XI which has to be sent as an attachement in an email on the receiver side.
    I am getting the mail with the attachement. But I would like to rename the attachment as the name of the picked up file.
    I am using Adapter specific message attributes on both sides but the attachment is named as untitled.xml.
    Please advise. Can this be achieved by using the swap bean or the message transform bean?
    Regards,
    Shobhit

    Hi Shobhit,
    The module tab of your mail adapter will look like this.
    Processing Sequence
    Module Name                                                            Type                                      Module Key
    localejbs/AF_Modules/MessageTransformBean   rename LocalEnterpriseBean     
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  mail     Local EnterpriseBean     
    Module Configuration
       Module Key               Parameter Name             Parameter Value
          rename      Transform.ContentDescription                      File
          rename  Transform.ContentDescription  attachement;filename="yourfilename.ext"                                                          
          rename            Transform.ContentType                 application/text;name="yourfilename.ext"
    Thanks
    Amitanshu

  • JMS ReplyTo Queue Name parameter in the receiver JMS communication channel

    Hi All,
    Can any please explain the use of JMS ReplyTo Queue Name parameter in the receiver JMS communication channel?
    Thanks
    Karthik.

    Hi karthik,
    JMS ReplyTo Queue Name parameter  is used for Specify the name of the queue to which the responses are to be sent.
    Thanks
    Govind.

  • 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

  • SAP PI: Using Variable Header  Binding in Receiver Mail Adapter

    Hello,
    I try to use Variable Header Bindings in the Receiver Mail Adapter. Therefore I wrote the following User-Defined-Function in a mapping:
    Java Function Start -
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName1");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName2");
    DynamicConfigurationKey key3 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName3");
    conf.put(key1, new String("Test1"));
    conf.put(key2, new String("Test2"));
    conf.put(key3, new String("Test3"));
    Java Function End -
    As expected I see the Attributes and Parameters in the Dynamic Configuration in the SAP XI Monitor:
    Dynamic Configuration Informattion Start -
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Mapping der Request-Message
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName3">Test3</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName2">Test2</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName1">Test1</SAP:Record>
      </SAP:DynamicConfiguration>
    Dynamic Configuration Informattion End -
    Now I configure my Receiver eMail Communication Channel and set the Variable Header Fields as follows:
       Adapter Specific Attributes: Checked
       Variable Transport Binding: Checked
       Variable Header (XHeaderName1): TSender
       Variable Header (XHeaderName2): TReceiver
       Variable Header (XHeaderName3): TOther
    With this configuration I would have expected three new Header fields in the Header of the eMail, the reicever gets. But they are not there.
    When I set standard attributes like THeaderTO, THeaderSubject a.s.o this works fine and the values are also set accordingly. Where it the mistake here?
    The PI version we are working with is PI 7.0 SP10.
    Your help will be highly appreciated.
    Thank you,
    Steffen

    Hi Luciana,
    Honestly, I cant really remember how or if it was resolved and I was just helping out on the issue, but another consultant continued with it, so unfortunately I cant be any help on this.
    Good luck!
    Cheers,
    Brad

  • Schedule Receiver RFC communication channel to call R3 RFC-FM.

    Hi,
    I have requirement that I need to schedule/trigger from PI to RFC call R3 function module. Wonder if anyone here has done similar thing before? I tried to use ATP (Availability time planning) in RWB. But this seem does not success for me as there is no response and error message for this.
    Below is my configuration detail:
    Configured:
    1. Receiver communication channel - RFC
    2. Receiver agreement with the RFC message type assigned.
    3. Scheduled receiver RFC communication channel via ATP daily
    *(It is possible to make scheduling job in R/3 but we are not considering this way)
    Please let me know if anyone has done this before or any other suggestion to do the scheduling from PI.
    Thanks!
    Regards,
    SP

    Hi SP,
    As you mentioned, ATP would allow adapter to be open and in start state. Adapter's RFC, SOAP, JMS would need some other application to trigger the message processing because these are not like pooling adapter's File, JDBC and Mail. RFC adapter channel always listening to the RFC port and FM execution. Once FM from R/3 executed then the RFC adapter would trigger it's message processing.
    For Sender RFC channel: In order to trigger the RFC adapter execution at particular time then you should write a simple ABAP code which would act a batch application and which does the triggering the FM and Sender RFC channel.
    For Receiver Channel: For Receiver RFC channel it's bit trichy because here you have force Receiver RFC adapter to connect backend the execute or initialize the variables without having any XI message triggered from Sender PI channel.
    I have 2 ideas:
    1. A little difficult approach, similar to the ABAPbatch code, you need to write a java adapter module which can trigger RFC receiver channel to connect and do an initialisation at FM at regular interval.
    2. Simple approch configure a File-> 2-> RFC receiver scenario, configure File sender adapter to pick a dummy file at regular interval and RFC receiver channel does the rest.
    Please let me know still you have any doubts,
    Thanks,
    RK

  • 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 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

  • Monitoring receiver idoc communication channel

    Hi All
    I have an idoc to idoc scenario.
    I am unable to see my receiving idoc communication channel in communication channel monitoring of RWB. It is not available in the dropdown list.
    I want to have a look at the audit log to see if the idoc is delivered to the receiving system.
    How can i monitor receiver idoc communication channel?
    How can i ensure that the idoc is delivered to the receiving system?
    In sxmb_moni, status is checkered flag.
    Many Thanks
    Chandra Sekhar

    Hi,
    IDOC is on ABAP stack hence u can not monitor IDOC.
    For testing purpose
    1) GO to SXMB_MONI check the status of message.
    2) Go to R3 and enter Tcode WE02 and check the IDOC which is send from XI. enter the idoc name and see the status of IDOC it should be in green status if it is posted successful or else see the status record for checking the error message.
    chirag

  • Receiver SOAP Communication channel -- Target URL

    Hi Experts,
    Can anyone provide some inputs for my below question?
    How the receiver SOAP Communication channel internally calls the Target URL?
    What is the internal process behind this call?
    I would really appreciate you all if could provide answers.
    Thanks & Regards,
    Prabu Muthu

    Hi...
    To be able to send SOAP messages from the Integration Server/PCK to remote clients or Web service servers, you must first configure the receiver SOAP adapter. The receiver adapter supports system acknowledgments but not application acknowledgments
    Find the below link .
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40611dd6-e66e-2910-f383-e80fb44f9cd4
    Regards,
    Leela

  • Send port with same file name as receive

    I have a filename "abc.docx". I need to create a send port where I should set the file name in a such a way that I should have the same file name as received.
    I have set the filename in the send port as "%SourceFileName%" but it does not seem to be working.
    How to set the send port to have the same file name as received by the receive port? Send location should hold the same file name

    could you please also mention what is happening when you set
    %SourceFileName% .  what kind of output filename are you getting then when used %SourceFileName%
    ?  incase if you are not getting any file at all in the output, then its not the issue with %SourceFileName%
     macro.
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Maybe you are looking for