Same source file name with a different extension

Hi All,
I have a source file which is dynamic all the time. Can I create a target file which has the same name as the source file but with a different extension.
Scenaio is file to file.
test. xml is the source file name and the target file name should be as test.csv
Regards,
Amar

Hi Amareshwar,
you can write a java code (either in UDF or import in imported archive and use in imterface mapping).
The piece of code is..
DynamicConfiguration conf = (DynamicConfiguration) myParam.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey Filekey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String OriginalFileName = conf.get(Filekey);
if (OriginalFileName != null)
NewFileName=OriginalFileName.replaceAll(".csv",".txt");
conf.put(Filekey,NewFileName);
And in Integration Directory>Configuration Scenario>your communication channels (both sender and receiver) just select
Adapter specific message attributes- File name
This would solve your problem.....
Regards,
Vishal Gupta
Plz reward points if you are satisfied with the solution.

Similar Messages

  • Same sender file name with a different extension

    Hello Friends,
    My scenario is I have an xyz.xml file coming and i need to have the same file name in the receiver but with a different extension as xyz.csv and the source file name will not be the same, it will be changing.
    Can you please help me on this.this is a bit urgent to me.
    Thanks in advance.
    Regards,
    Kumar

    Kumar,
    Write <b>UDF</b> with <b>no input</b> parameters.
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        “http://sap.com/xi/XI/System/File”,
        “FileName”);
    String fname = conf.get(key);
    StringTokenizer st = new StringTokenizer(fname,".");
    String[] name = new String[2];
    while(st.hasMoreElements())
    for(int i=0;i<1;i++)
    name<b>[</b>i<b>]</b>=st.nextElement();
    String finalname = name[0]+".csv";
    conf.put(key,finalname);
    <b>Mapping Logic</b>
    UDF -
    > Target Rootnode.
    Make sure that u checked the Adapter specific message attributes in both comm.channel.
    If you have doubts reply back.
    Best regards,
    raj.
    Message was edited by:
            Raj

  • Determine Target directory from Source file names with out mapping

    Hi All,
    I have a requirement to determine the Target Directories from the Source file names.
    File Sender Adapter - XI - File Receiver Adapter
    In this scenario I am not doing any mapping. Source File directory contain 3 files. These file should go to 3 directories in the Target Server.
    Please help me how can meet this requirement
    Thanks in advance
    Kevin

    Hi Kevin,
    if you can separate the files by name. have 3 sender communication channels each picking up one of the files (you do this by making the regex in the file name mutually exclusive) and then send them all to the target system using the same comm. channel.
    regards,
    Horia

  • PDF file transfer writing target file with the same source file name

    Hi to all,
    I want to transfer a PDF file from a SOURCE folder to a TARGET folder. My problem is that I want the target pdf file has the same name of the source pdf file. How can I do this? I have to look for some parameters in the sender or receiver channels?
    Thanks to all.

    Hi Gabriele,
    If you want to FTP the pdf file from source to target directory, use this blog.  It doesn't require any IR devlopment.
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    Also, In sender and receiver comm channels select "Set/Use Adapter specific message attributes" and "File Name" to get the same file name in the target directory.
    Regards,
    Sreenivas

  • File name with different type

    Hi,
    I need to send specific date format with file name to two different receivers. So the file name is same for both the two receivers but file extension is different. So I configured with dynamic configuration in UDF and in the receiver channel i have given .txt and .dat but it is not working. Can we do it in any other way.
    Thanks,
    kum

    Hi Kum,
    If I am not wrong, you must be using conditional receiver determination for determining 2 receivers.
    In this case, you can define 2 separate mappings which you can call in Interface determinations (2 interface determinations).
    In one mapping, you can have UDF for .txt file and in other .dat file.
    -Tanaya.

  • Re-link files with a different extension

    POSTED by ToddNewOrleans in duplicate (now deleted) thread:
    Hi,
    I haven't seen a solution to this, but the question has been posed.
    I was sent a hard drive with media to edit. I had to change the file extension of all the clips (long story). The clips however, are named the same.
    I'm working with a director in another state who has the same clips I had to change the file extension to. He has edited a rough cut using the the QT clips and sent me the PP Project. I'm trying to re-link the clips, which total 350. I can manually re-link these to my clips with the different extension....which is a pain. I would like to batch link these. Is there any way to do this?
    We are both working in CC2014 v8.1
    I'm in Windows, he's on a Mac, which is no problem as we've worked on films like this before.
    Also, the reason I had to change the ext is a ling story. I just need to know if batch re-linking is possible with a different ext.
    Thanks,
    Todd

    Posted by ToddNewOrleans in a duplicate (now deleted) thread:
    Hi, and thank you both for replying.
    I received the footage which was encoded using a tricaster. I was given a hard drive which contained these files and a PP Project, all having a Quciktime wrapper. When I tried to open the project and link the media, I kept getting a "file import failure", error message "codec missing or unavailable". However my colleague is able to open them. I'm on a pc, he's on a Mac. I've never had any issues importing media. When I checked the codec on the clips, it says xd54. I researched and it was shown as XD Cam codec, which I've never had a problem with. I researched and found that it might be a proprietary Avid or FCP version. I was unable to open any of them in QT Pro (up to date), but was able to open them in Media Player Classic. This lead me to believe that there was something wrong with the wrapper and the codec.  I started thinking about it and changed the file extension on a clip to .mp4 and was able to import it. I dup'd the folder and batched changed the file extension of all the clips.
    I downloaded a trial version of a Calibrated XD Cam Decode which worked on the QT clips but left a watermark and cost $150, out of my budget for this film.
    I read somewhere that PP doesn't understand a Quicktime wrapper using that codec, as it isn't normal to have that. I have a Sony EX3 Cam which encodes as .mp4's and also use the Sony FS100 which encodes as .mxf's. XDcam is a Sony codec.
    IDK...I'm trying to understand all this myself. That's why I was hoping to re-link with a different extension as it took forever to re-link these clips. I will be sent another project ile using those same QT's that don't work.
    GRRR! LOL!
    Thanks,
    Todd

  • Need Target File  Name  Timestamp  is  same  as Source File name Timestamp

    Hi ,
           I want to genereate Target file name (Target_09062008082030.xml)   but  this time stamp is exactly Sorce FileTime stamp..(Source_09062008082030.xml)..
         so, i want to create a  target file  with the same source file time stamp.. 
    for this.. i sed Message Specific attributes... in both sender and receiver side.. but  that was creating with the complete name.of source file name.. but i want only Timestamp of the source filename... and remaing is the constant.. for this  how can i proceed  ..
    Thanks
    Jain

    See in Sender CC when you set the Adapter Specific Message Attr  for file name it will send the filename in the header of the XI Message.
    To acces this file name inside mapping you need to create a UDF . The type can be any thing as you desire.
    You dont need to pass any variable .if suppose you want the file name (constant) e.g ABC_<timestamp>.xml
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fileName= conf.get(key);
    //see above your key is FileName which will be sent by the sender CC automatically... You are simply accessing it here using get() method.
    //now ur filename will contain name of the source file... you need to perform a substring operation to get the timestamp and create a new file name as you desire.
    fileName = "New_<timestmp>.xml"; //for e.g
    //set this file name again in header message using put()
    conf.put(key, fileName);
    //when you check on the adapter specific message attr for fileName in the receiver CC ,it will automatically take this new file name value.
    return fileName;
    // if you want to use this new fileName inside your mapping payload (for other fields) you can assign this to any target field,else just assign it to the root tag which will make no difference if this file name is not used anywhere.

  • Camparing file name with a value of the field in the source

    Hi All,
    I have a file sender. I need to compare the file name with the value of a field in the source and then map to the target.
    For example:
    <Record>
         <Date>20071103></Date>
         <name>abcd</name>
    </Record>
    the name of the file would be 20071103. i need to check this file name with value in 'date' field , if its true then we need to map it to target
    please suggest some way to meet the reqirement
    thanks
    jhansi

    Hi,
    Here is the reason i need to do this:
    The data is loaded by DTP in process chain. Overlaping requests are deleted. But, iIn some cases requests with the same selection options  need not to be deleted. My idea was to change selection options in Manage(infocube) with Abap program without changing selection options in DTP filter,  so that the system would not recognize requests as "overlaping requests".
    So, where is the information about shown in the field Selection Options is stored? In which tables?
    Thanks
    Tigr_Z

  • Need to genereate Target file name same as Source File Name thru Local J2SE

    Hi Everyone,
    I want to genereate Target file name exactly same as Source File Name. I know how to handle this in Central Adapter Engine(Sender & Receiver Communication Channel).
    But I need to do this in Local J2SE adpater engine.
    Please help me in this regard.
    Thanks & Regards,
    Nagaraju

    U can use the parameter to save the filename in the message header
    file.messageAttributes=<name,directory>
    This is similar "Adapter-Specific Message Attributes" concept.
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/246b3de666930fe10000000a114084/frameset.htm
    Regards,
    Prateek

  • The source file encoding may be different with this platform encoding.

    I got the below error after I have upgraded my Iplanet from 4.1 SP3 to 6.0 SP5 so what seems to be the problem here ? The code is working perfect under 4.1 SP3.
    [02/Jan/2003:00:01:35] info (10457): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP/software/data
    /stage/mainBean/printParser2.java:1: The source file encoding may be different w
    ith this platform encoding. Please use -encoding option to adjust file encoding,
    or apply native2ascii utility to make source file ASCII encoding.

    Looks like the file has been save in a non-ascii format. Perhaps someone opened and saved the file as a Word document and the compiler is unable to re-compile it. Try opening the file in Wordpad and resaving it in TextFormat.

  • Does a member class have to be within the same source file?

    Hi there,
    I have this application that extensively uses two classes. The main class setsup the GUI, and the second main class is responsible for handling all of the actions that arise from the GUI.
    I could have done this by making all of my handler methods be of the first main class, but this class really is just for the GUI setup, the logic doesn't fit into this class' behaviour.
    The class that handles the GUI actions is required to use the fields of the main class e.g. to get values of a text field. The problem is that since the class that handles the actions is getting very big, I would kind of like to move this class into a different source file - because currently it is a member class of the first one, so that it can access all of its fields.
    Is there some way that I can move this handler class into another source file, and still have it access all of the fields of the main GUI class - without making the fields public, or using millions of get/set methods? Also, I can't use inheritance because the both the GUI class creates an instance of the handler class in its constructor, and so leads to an infinite loop when trying to instantiate the GUI class.
    Can I ask.. would a static class or something be of use here? Do they exist? I'm confused as to how to do this without getting the mother of all source files (in size that is - nothing to do with cooking or baking).
    - Anyway, thanks in advance for any help that you could give me -
    BYEE, Edd.

    You can't have an inner class that is not in the same source file. However, you could use package-protected (default) access to give another class in the same package access to things without making them public. Actually, that's how inner classes are actually compiled. Package-protected access is underused IMHO. It's a great tool that most people (including myself) are suspicious of at first.

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • Condition based on source file name - PI 7.1

    Hi Friends
    I have an file2file interface without any mapping requirement , source is sending  .csv files and I need to post those source files to two target systems in which each target system have two directories where I need to post based on few conditions and here are my queries.
    1. As mapping is not required I guess File Content Conversion is also not required as I simply pick and drop the .csv files into target - please confirm.
    2. One of the condition is :  source file name will be XXXX-AABB-C-XXXX-XXX-XXX.csv , here SAP PI has to read the company code (AABB) to determine the target system. Z001 and Z007 should be sent to TARGET1 & All other files will be sent to Target2.
    3. 2nd Condition : SAP PI has to read the type of file indicator (C). The files will be sent to the following target application directories:
    Simulation files (indicator = S): /interfaces/XXX/simulation
    Production files (indicator = P): /interfaces/XXX/inbound/
    Please kindly provide your ideas/solutions .
    Regards
    Suman.

    Hi Suman,
    If the Target is two different locations, then i guess you need to have two receiver Channels. Please check the below thread for details:
    Re: Genrate file in 2 different locations
    Incase of different directories in same server, you can check out this link:
    Dyanamic Configuration at receiver file adapter determine target directory
    kanan

  • Change Source File Name

    Hello,
    Sometimes when I change the name of songs or videos in iTunes, the name of the source file changes, and sometimes it doesn't.
    When I say "source file," I mean the name of the file that comes up when I look at the contents of a folder via "My Computer" in the Windows interface.
    I'd like a change of the iTunes name to always change the source file name. Can anyone help?
    Thanks
    Ben

    i added music to a clean, newly installed iTunes from a music folder on my desktop with subfolders for different cds that i downloaded recently. after i added those folders to iTunes, i changed the artist names and album titles. the files changed in the folder on my desktop...the only thing that won't change is the song title...it's odd!

Maybe you are looking for