Filename in Attachement payload

Hy,
I have to detach an email attachement on my file System.
That's works but I'm not able to maintain the same filename.
Can anybody help me.
Thanks
Mat

Hi Mattia,
If your file name is a part of your email atttachment ( the payload ), then you can dynamically create your file name.
To do this,in the filename of the receiver file adapter, give the filename a <b>%var%</b>.
Anything between % is treated as a varibale by XI. Now, under variable name substitution, you will have to give the value of var and this will act as the filename.
You can access the payload using <b>payload:</b> and the XPATH.
For info on how to do this, check the topic<b> VARIABLE SUBSTITUTION</b> in this link.
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
hope this helps,
Regards,
Bhavesh

Similar Messages

  • Get Filename from attachements payload

    hallo,
    I receive email with attachement.I would like store the attachements on the file system (with a receiver File Adapter) with the same name.
    Could someone give a tipps.
    Thanks a lot
    Mat

    Hi,
    Option 1: Use the Module Processor code in the Mail Adapter and get the file name and use it in the Receiver File Adapter as a variable substitution.
    Option 2: Use java Proxy to invoke the MailBox and detach the attachment and construct the XML message and send into XI.
    Hope this helps..
    Regards,
    Moorthy

  • Processing the filename in the payload

    Hi,
    I am getting the filename in the payload, I want to read that file.
    How do I achieve this..
    Regards,
    Varun

    Hi,
    For Example if we want to get the Input file name & Directory Details into Target message.
    Ex:
    I/P File name is :::::231004.xml  Ftp Serve Path : //xideveloper/Test_XI/PO
    O/P File name can be :::Any thing
    Input File :  231004.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TEST_AGCO xmlns:ns0="http://tafe.test.com">
       <Header>
          <NAME>giri</NAME>
       </Header>
    </ns0:MT_TEST_AGCO>
    Output File : Out.xml
    Here in this output we are able to get the Filename & Directory Info in the FileName_1 Field.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_target xmlns:ns0="http://test.com">
    - <Header>
      <Name_1>giri</Name_1>
      <File_Name_1>231004.xml //xideveloper/Test_XI/PO/</File_Name_1>
      </Header>
      </ns0:MT_target>
    You should capture the Source File name & Directory Info into Target Message.
    1)     Write One UDF & Map Like Constant(u201Cu201D)---UDF----FileName_1
    2)            In Advanced mode check the check box Set Adapter-Specific Attributes
    3)     Check the ASMA Parameters in Sender Adapter Alone
    4)             No need to check the check box ASMA in the receiver side
    UDF Code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //for getting filename
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //for getting directory
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    /similarly for getting filetype, filesize you need to specify in the above code instead of filename or directory/
    String FileName = conf.get(key1);
    String Directory = conf.get(key2);
    String Cat = FileName+ " "+Directory;
    //return FileName;
    //return Directory;
    return Cat;
    Regards
    Seshagiri

  • Mail receiver adapter: change filename of attachment to number in payload.

    Dear experts,
    I want to send out Purchase Orders from XI to a email address. The XI message containing the Purchase Order is sent as an attachment to a email to the supplier. However, the filename of the attachment needs to unique. Preferably the PO number which is in the file content.
    Can anybody help me out with how to accomplish this?
    My current settings are:
    Transport protocol: SMTP
    Message Protocol: XIPAYLOAD
    Not using mail package
    Keeping attachments.
    Using: MessageTransformBean
    Transform.ContentDisposition --> attachment;filename="testing.xml"
    Please tell me how to dynamically change the "testing.xml" part!
    Thanks in advance,
    *will reward points if helpful

    Thanks Prateek!
    This is what I was looking for.
    Can you please do me one more favour?
    How to include this code in the module? I have been looking on help.sap.com but only found to be able to do this in PCK. Is this correct?
    How can I use the code?
    Thanks in advance.

  • Accessing the filename in the payload

    Hii
      I want to process the filename (eg:sample.xml) from the payload of the message.
    <Message>
          <Method/>
          <Source>sample.xml</Source>
          <Target/>
       </Message>
    And use the filename in other scenario.
    Regards,
    Varun

    Hi Varun
    Use variable substitution
    File name : %FileName%
    Enable variable substitution in Receiver File adapter.
    Variable name = FileName
    Reference = payload:Message,1,Method,1,Source,1
    For more info refer
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Thanks
    Gaurav

  • Sender filename in receiver payload without using mapping.

    hi Experts,
    I have a File to RFC scenario. wherein i need to pass source filename and filepath as parameter to RFC whenever file arrives at source directory.
    I am not using IR contents. What could be the simplest way to achieve this.
    One way ofcourse is to write an adapter module to generate Receiver payload with the required information.
    Can we have even more easier way to achieve this. Can something be done in Content conversion to get the receiver xml payload with filename and filepath?
    Regards,
    Girish

    Hi Girish
    You can use  IR mapping for a binary source data, but it must be a Java class, not an abap or graphical mapping.
    Regards,
    Carme.

  • Filename extension in Payload Swap bean

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

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

  • Show originally filename in attachment list (generic object services)

    Hello everybody,
    does anybody know, if it is possible to show the originally filename of a document in the attachment list of generic object services?
    If I add more than one document for the same document type in generic object services, I'm not able to distinguish the documents.
    When I want to save an attachment to local PC, SAP offers me the originally filename as default. Therefore, the filename has to be saved somewhere...
    Thanks for any help or ideas in advance,
    Peter

    Richard,
    Your using the wrong object, I don't have access to an SAP system right now, so I can't tell you what the correct object is, but when it's configured correctly in OAC3 it will not be grey out.  Best thing to do it see what the object the program is publishing.  This is what GOS is looking for.  IFARCH21 is not the answer, unless your using workflow

  • Mail-Adapter adds ".bin" to filename of attachment

    Hi!
    I'm sending mails with a dynamic generated filename using the mail-adapter and mail-package. The file extension of the attachment should be ".txt" and the content-type should be "application/EDIFACT"
    When I change the content-type of the attachment in my adapter module by
    TextPayload attachment = msg.createTextPayload();
    attachment.setName("something_dynamically_generated.txt");
    attachment.setContentType("application/EDIFACT");
    The content-type is changed properly, but the file extension ".bin" is added.
    The result is in my example:
    something_dynamically_generated.txt.bin
    How can I stop XI from extending my filename?
    I tried with the MessageTransformBean, but it had no effect.
    Best regards,
    Daniel

    Hi Sudharshan,
    we upgraded from SP15 to SP18, then the problem occured no more.
    I created the attachment in an adapter-module for the mail adapter. Sample code:
    TextPayload attachment = msg.createTextPayload();
    attachment.setContentType("Application/EDIFACT");
    attachment.setName("SomethingDynamicallyGenerated.txt");
    attachment.setText(string_which_contains_the_new_payload);
    msg.addAttachment(attachment);
    It seems that the mail adapter checks now if a filename extension is given. If this is the case, it adds no extension by itself.
    I tested different configurations like mail package and variable transportbinding / adapterspecific attributes, it worked every time.
    Best regards,
    Daniel

  • Changing filename of attachment using GOS

    Hi Gurus ,
    I am in the middle of the technical issue related to the  GOS_EXECUTE_SERVICE function module.
    Everything is working fine but when i am attaching a file from my pc, it's taking the filename as it is. it sounds good.
    But here comes the problem, i have a requirement of adding the filename starting with a common name.
    Suppose i have attached a file and it's name is abc.pdf but i want to display it as zbp_abc.pdf.
    Thanks and Regards.
    Dhananjay

    Hi Himanshu,
    Thanks for your first reply
    I have used this function module.
    CONCATENATE ls_final-pernr ls_final-reinr INTO
             ls_object-objkey.
             ls_object-objtype = 'BUS2089'.
             CALL FUNCTION 'GOS_EXECUTE_SERVICE'
               EXPORTING
                 ip_service           = 'VIEW_ATTA'
                 is_object            = ls_object
                 ip_no_commit         = ' '
                 ip_popup             = 'X'
                 ip_rwmod             = 'E'
    *           IT_SERVICE_SELECTION =
    *           IP_VSI_PROFILE       =
               IMPORTING
                 ep_event             = lp_event
                 ep_status            = lp_status
                 ep_icon              = lp_icon
                 ep_message           = lp_message
               EXCEPTIONS
                 execution_failed     = 1
                 OTHERS               = 2.
    It's working great. but i want to add a prefix before the file name. means after saving the file it must look like tv_abc.pdf and not like abc.pdf.
    But file which i have selected from desktop is abc.pdf and after attaching it looks like tv_abc.pdf on screen.
    Thanks in advance.
    Regards
    Dhananjay

  • Filename of Attachment in Mail

    Hi,
    We have a scenario in which a mail with body and attachment (an excel sheet) has to be sent.
    We have configured MessageTransformBean and PayloadSwapBean to manage this. However, we are getting both files as attachments and there is no mail body.
    Moreover, we would also like to have filename with timestamp attached to it.
    Please provide your inputs at the earliest. Helpful answers would be surely awarded with points.
    Thanks,
    Bhavish

    Hello  Bhatia,
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    And also check....
    Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    Dynamic File Name Part 2
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    With Regards,
    Vidya
    *************please reward with points if found useful

  • Outgoing email that features both a body text and an attached payload.

    Hi All,
    I am searching for a way to create an outgoing email that features both a body text and a payload that is sent as an attachment.
    I am not using Mail package.Is there any way to achieve the same.
    Thanks
    Nidhi

    Thanks Abhishek,
    I have gone through the blog suggested by you.
    My scenario is little different.I am not using mail package & I am doing content conversion on the file at receiver mail adapter side using TransformBean module.
    Without using standard mail package,is it possible to achieve the requirement.
    Thanks for your help
    Nidhi

  • Fail read filename from attachment in multipart message

    Hi,
    I use Javamail 1.4 for reading mail from imap server.
    Sometimes i have received mail with this header (this mail was produced with thunderbird):
    --------------040307090809070400040607
    Content-Type: application/pdf;
    name*0="20060908 - DOCUMENT.pdf"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
    filename*0="20060908 - DOCUMENT.pdf"
    When i use the method part.getFileName() the result is null.
    Why?
    Thanks all.

    Interesting. What version of Thunderbird?
    These headers are using a feature of RFC 2231 that allows
    a parameter in a header to be split over multiple lines.
    In this particular case, there's no need to use this feature
    since clearly these parameters are short enough to fit on
    one line.
    While JavaMail supports part of RFC 2231 - the part that
    allows parameters to be encoded - it doesn't support this
    aspect of RFC 2231.
    I would suggest reporting this as a "bug" in Thunderbird, that
    it's gratuitously using this new feature in cases where it's not
    needed, and thus reducing interoperability with other mailers
    that don't support this feature.

  • Retrieval of attachment filename - receiver mail adapter

    Hi,
    I am using the mail adapter to receive an e-mail into PI. This e-mail has an attached CSV file.
    First, I am using the PayloadSwapBean to swap the application playload to the attachment payload
    Second, I am using the MessageTransformBean to transform the CSV file into an XML document
    These are both working fine and the message is then passing into the relevant message mapping.
    However, I would like to be able to use the attachment filename in the message mapping.
    Can anyone advise how to do this for the mail adapter ?
    I've done it loads of times for the file adapter but never the mail adapter (when using attachments) so I am a bit stumped.
    Any advice greatly received.
    Cheers
    Colin.

    Hi Progirl,
    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.
    I read from your response. You had created adapter module for the similar purpose. Can you share it. Since I am new to  writing Adapter Module.
    Thank You in Advance.
    Mukhtar

  • File-to-Mail attachment without manipulating the payload

    Hello, I have a requirement to pick a file from a file server and send it to receiver as an email attachment as-is. The key is that the system should not read the contents of the file (payload). I'm unsure how to go about this! Any help in this regard is appreciated! Thanks!

    I created a Java bean to read the file name available in Adapter-Specific Message Attribute (ASMA) and set it in the payload content type. Here is the code to be put in the process() method in the Java Bean:
                            String fileName;
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   Payload payload = msg.getDocument();
                        MessagePropertyKey mpk = null;
                        mpk  = new MessagePropertyKey("FileName", "http://sap.com/xi/XI/System/File");
                        fileName = msg.getMessageProperty(mpk);
                               if(fileName == null) fileName="mytestfile.txt";
                             payload.setContentType("text/plain;charset = \"UTF-ISO-8859-1\";" + "name=\"" + fileName + "\"");
                   inputModuleData.setPrincipalData(msg);
                   } catch (Exception e) {
                        throw new ModuleException(e);
                   return inputModuleData;
    Thanks to all those that helped me addressing the issue.

Maybe you are looking for

  • How do I view playback position while a clip is playing?

    I just want to see where I am in the clip. For example, 5:03... 7:14... etc. I literally cannot figure out how to simply show where I am in the clip. This seems ridiculous. What am I doing wrong?  I have clips I need to edit based on time stamps... w

  • Anonymous User Login

    Hi All, I have an issue with 'Forgot Password' button in the end user login. When a Forgot Password button is clicked, a Question Login workflow will trigger (I think I am right?) .Now I would like to customize the 'Question Login' workflow as per my

  • DW CS 4 slow down

    I essentially got my GL CS2 site into DW (I think they made the wrong choice if GUI is the main consideration). So, I was trying to set up a page for the first time, and drop in a few pictures. Well, now, whenever I open DW all I get is a spinning ba

  • HT4889 How I make copy from iBooks on my iPad to iBooks on Mac Pro , without deleting my iPad books most of them not purchased books , thanks

    I want to make another copy of my iBooks on iPad to iBooks in Mac Pro device without deleting my any book from my iPad . All the books are not purchased from apple store .   Thanks 

  • Monitor stopped due to setup error or custom action

    Hi folks, i have installed the sun cluster and created a resource group for my oracle database. I have created resourece's for database server and or listener. My question is when I am issuing the scstat command on my oracle server resource i get the