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

Similar Messages

  • Writing the filename as the prefix for bates or page numbering during batch process.  PRO 9

    While batch processing in Acrobat PRO 9 I am trying to insert the file name as the prefix automaticily either for page numbering or bates labeling.
    Not very good with javascript.  Any one have any ideas?
    Everyone is always asking to have the filename as the prefix and it starts to wear on you after 1000 exhibits.

    Don't know what script you're using, but this command will return the document's file name:
    this.documentFileName
    and this one will return the full path:
    this.path

  • Retaining the FileName in the Receiver FTP adapter

    Hi experts,
    I have a situation here, were i need to retain the FileName in the message header in the receiver FTP adapter.
    I have tried using variable subtitution but seems the FileName is not supported in variable substitution.
    Please help
    Thanks

    Hello,
    if you need file name to be retained in the receiver adapter from the sender side. then u can do that by dynamic configuration using adapter specific message attributes, check this blog for details-
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    if you dont have a mapping in your interface to use dynamic configuration, then you can do it via adapter module also- have a look here, /people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
    regards,
    francis

  • I need to start and stop logging based on a digital input event(or analog if necessary), log data for several seconds prior to the event, and have the data file close at the end of event and increment the filename for the next logging event.

    I don't know if this can be done with VI Logger or need to use Labview V7.1.

    After browsing through the VI Logger User Manual, it looks like the triggering that you are hoping to accomplish is possible. However, incrementing the filename for the next logging event is not going to be possible. VI Logger does exactly what its name tells - logs data. I don't think the automation that you are hoping to accomplish is possible.
    For help with setting up your application, if you do choose to stay with VI Logger, make sure to chek out the Getting Started with VI Logger Manual.
    Best of luck.
    Jared A

  • How to get the filename of the active jsp page?

    how can i get the filename of the active jsp page?

    You could register the JSP [ages in the web.xml and then use the ServletConfig.getServletName.
    You could use the JspContex.getServletName which will return the registered name or the name of the servlet class.
    You could programmatically add a page context attribute that holds the jsp page name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to see the filename of the photos available in the iphone without downloading them or connecting to any other device

    I am unable to find the filename of the photos available in my iphone 5. How should i get that?

    You can't view that on the iPhone natively.
    You can, however, import the pictures to your PC or Mac and view the file names there. They should be in the IMG_XXX format.

  • I need a script that copies the filename into the file

    I need a script that copies the filename into 4th column of each line in the text doc file.
    I have over 2000 different file names each containing 6 columns and ~50-100 rows.
    I can do this manually using this script:
    awk '{print $1"\t"$2"t\"$3"\t <name> \t"$6}'
    But I would like an automation command or script. Is there any command that I can use instead of <name> that will copy the filename into the column?
    Thanks
    Monica

    Oops, I forgot the redirect to a file. It's not a good idea to edit files in place. A script could fail and you're left with at least one file ruined. It's better to create new files then delete the old files.
    for file in *; do
        while read col1 col2 col3 col4 col5 col6; do              
            printf "%s\t%s\t%s\t%s\t%s\n" $col1 $col2 $col3 $file $col6
        done < $file > n$file
    done
    You could narrow the files listed such as
    for file in *.tsv
    and redirect the new files to another directory. Such as
    done < $file > /absolute/path/to/directory/$file

  • Get only the filename not the full path of the file.

    hi to all..
    how can i get only the filename of the file not the full path and to be placed on a textinput.?
    example:
    when i'browse the file and select sample.txt
    "C:\Users\user\Desktop\folders\sample.txt" this will be inputted on the textinput.
    however, what i want to have is when i'browse and select a file..
    textinput should only contain "sample".
    does anyone knows how to do it?

    Hi cyrus@adobe,
    How are you getting the full path of the file when you browse, I dont think for security reasons the Flash Player will aloow to do so. You can only get the file name not the full path of the file when you browse.
    Are you using Flex4..?? I am not sure whether this is possible in Flex4..However if you are getting full path and if you wanted to show only the filename then you can just use theString class split function to acehive this..
    var fullPath:String = "C:\Users\user\Desktop\folders\sample.txt";
        var splitPath:Array = fullPath.split("\");
        textInput.text = splitPath[splitPath.length-1];
    Thanks,
    Bhasker

  • Is there a possibility to print the filename into the picture?

    Is there a possibility to print the filenames into the picture or into the slideshow? When presenting photos to clients over Apple TV there must be a way to find the image name for ordering.
    Any ideas, I did not find anything!

    Unsure about slide show in Ap, but when printing llok for this dialogue box, it prints any metadata;
    You just need to select the more options bottom left.
    Tony

  • Receiver determination based on the filename of the incoming xml file

    hi folks,
    is it possible to base the receiver determination from the filename (pattern) of the incoming xml file?
    suppose, if the filename is partner1.xml, then the receiver determination has a condition of partner1.  in this case, the message is received by partner1.
    any advise please?
    thanks!
    -lex

    Hi Lex,
    You can use Enhanced Receiver Determination for this. Do your normal mapping from source to target. And another mapping for the receiver determination. In that mapping you can use the UDF for Dynamic Configuration and set the filename as the receiver service name.
    Use the following blog for Enhanced Receiver Determination:
    /people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16
    This blog explains the usage of Dynamic Configuration:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Sanjeev.

  • Grabbing the filename of the document a dynamic stamp is being placed into.

    I need to get the filename of the "parent" document a stamp is being placed into to put into one of the stamps textfields. This was what I was hoping would work inside of stamps textfield custom calculation:
    event.value = app.activeDocs[0].documentFileName;
    Thats a no go. For some reason activeDocs is always empty, despite the fact I have 3 pdfs open. Does anyone have any ideas on why this is not working? Have a better idea to do the same thing?
    Thanks for your help.

    Thank you! Works great.
    And for those looking for the quick answer in the future:
    event.value = event.source.source.documentFileName;

  • 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

  • Retaining the fileName inside the zipped files

    Hi Experts,
    I am working on a file to file scenario, in which the files have to be picked up the files in pair(pdf) and zip them  and post in the particular folder.
    I have used PayloadZipBean for zipping the files, but not able to get the original file names inside the zip, but i am getting one Mail and one additional file.
    This thread seems to be similar to my problem:
    Re: ZIP FileName (Additional Files)
    Please suggest.
    Thanks,
    Sushama

    Hi,
    I have done developed an adapter module for retaining the file name, before PauloadZip Bean, in receiver file adapter:
    package sample;
    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) inputModuleData.getPrincipalData();
            Payload payload = msg.getDocument();
            String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File",
                                                     "FileName");
            if(fileName == null) fileName="default.txt";
            payload.setContentType("text/plain;charset = \"UTF-8\";"
                                   + "name=\"" + fileName + "\"");
            inputModuleData.setPrincipalData(msg);
        } catch (Exception e) {
            throw new ModuleException(e);
        return inputModuleData;
    But, I am getting corrupted files .
    Please advise.
    Thanks,
    sushama
    Edited by: sushama pandey on Sep 28, 2011 4:52 AM

  • How to get date appended in the filename of the IR reports

    I have a requirement where in i need to generate the output for the IR reports with a date appended in the output name.
    The report is scheduled daily. The generated output should have a date appended to it.
    For example - if the report say 'abc' gets generated today then the name of the generated report should be abc_26/10/2009.
    I could find one option saying append date to the filename while adding a schedule to the report. I have checked that property but still while generating the report i am not able to see the date appended with the report name. It just takes the cycle name that i had mentioned.
    I am using IR 11.1.
    Any help is appreciated.

    Do to the complexity of the program we need to run it with sequences.  This is because we need to aquire data with DAQ until it reaches a certain point and then stop collecting so that it can do its process (only once for all times criteria is met), and then loop around till again collecting after DAQ drops back below certain point looking to once again reach that point.  Another flat sequence is going outside of this where I want to put the prompt and have a user input to affect how many times that that the inner loop is run (No a For Loop instead of the while loop will not work either for other reasons). 
    I just want to know if after the program starts you can have a user input that will change the effect of the rest of the programs action based on the number inputed.

  • Is there a way to automatically insert the filename in the footer of a spreadsheet using iWork's numbers 3.2?

    Is there a way to automatically insert the filename of a spreadsheet into the footer when using iworks numbers 3.2?  iworks 09 had this feature and I can't find this feature in the new version of numbers.

    Hi rhyolite,
    In Numbers 3.x, The Print View and Layout View have gone (for now at least). Page Headers and Footers can only be reached under Menu > File > Print... to open Print Preview. Hover the cursor to reveal the Page Header and Footer fields.
    The only inserts that I can get to work in Print Preview are Page Number, Page Count and Date & Time. Filename is no longer in the Insert menu.
    Regards,
    Ian.

Maybe you are looking for

  • HP LaserJet CM1415fnw stop printing

    My CM 1415fnw stopped printing today from every computer in the house. I have had this printer for about a year without any other problems. The wirless network test report states "pass" but the HP Toolbox FX states printer not connected to the networ

  • Connecting my MacBook Air (Mar./2013) to TV

    I have researched using Apple TV or a cable.  I had decided on Apple TV then discovered that it does not include an HDMI which I believe I need anyway. Therefore, why not just use the cable?  If so, what adapter - or anything else  - would I need? Is

  • N70 freezing and ringtone issues

    Hey there hope someone can help me please. Ive rang orange customer services and spoke to them about my issues with the nokia n70. The phone brings up the nokia logo on a white screen and stays there for about a minute then goes away leaving the phon

  • Custom Tag's

    I've been looking at the following two tutorials which I understand, well I think I understand. http://today.java.net/pub/a/today/2003/11/25/tagfiles.html http://today.java.net/pub/a/today/2003/11/14/tagfiles.html I thought I'ld experiement & make a

  • Installing OracleVM on Linux 64 bit machine

    Dear Experts, Sorry for such seemingly dumb questions. I have a 64 Linux server. Redhat 5.5. When I downloaded the Redhat files, I also downloaded Oracle VM. /download/oraclevm64/V21104-01.zip /download/oraclevm64/V18419-01.zip /download/oraclevm64/V