Appending the Original File Name as Suffix to Receiver File Name

Been searching and I've seen Michael's blog about creating a UDF to place the original file name in the payload.    Since this is a file->file scenario, I have no mapping. 
I have the Adapter-Specific Attributes turned on on the Sender to pass the file name in the DynamicConfiguration of the message header and I can see it in the message.
What I want to do it to have a target file name in the form of:   XXXXX_<i>originalfilename</i>.
So I have turned on variable substitution and created a variable called 'file'.
In the File Name Scheme Parameter I have entered: XXXXXX_%file%
If I set the variable substitution refererance for 'file' to message:message_id, my file name is created as XXXXX_message_id,  or any of the other options from -> <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm">SAP Adapter Help Page</a>
How can I get the value of FileName as the value for my variable %file%?

> Actually, what I meant was the mapping will not know
> the value I have entered in the receiver
> communication channel - File Name Scheme parameter
> value.   For example in CC for Target System 1  the
> FNS = FMRECEIVER1, the CC for Target System 2 the FNS
> = FM_RECEIVER2 and so on.  
>
> Are you saying in the mapping I could access the
> value of FNS from the communication channel in the
> mapping?   
No, you cant read in mapping what you set in CC.
However, you can ignore the parameter FileName scheme in CC and just set it in mapping runtime.
The way you are using, you'll have to maintain the prefix for each receiver adapter you have. If you had it in mapping, you could just do something like:
String receiver = container
    .getTransformationParameters().
    .get(StreamTransformationConstants.SENDER_SERVICE);
DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
    “http://sap.com/xi/XI/System/File”,
    “FileName”);
String orgFileName = conf.get(key);
String tgtFileName = receiver + "_" + orgFileName;
conf.put(key, tgtFileName);
and then you wouldn't have to maintain the file name scheme in CC.
Regards,
Henrique.

Similar Messages

  • Appending multiple *.csv files while retaining the original file name in the first column

    Hi guys it's been awhile.
    I'm trying to append multiple *.csv files while retaining the original file name in the first column, the actual data set is about 40 files.
    file a.csv contains:
    1, line one in a.csv
    2, line two in a.csv
    file b.csv contains:
    1, line one in b.csv
    2, line two in b.csv
    output.csv result is this:
    I would like this:
    a.csv, 1, line one in a.csv
    a.csv, 2, line two in a.csv
    b.csv, 1, line one in b.csv
    b.csv, 2, line two in b.csv
    Any suggestions to speed up my hobbling attempts would be aprieciated
    Thanks,
    -SS
    Solved!
    Go to Solution.

    What you could do is given in the attachment.
    Started with 2 files :
    a.csv
    copy of a.csv
    Both with data :
    1;1.123
    2;2.234
    3;3.345
    Output :
    a.csv;1;1.123
    a.csv;2;2.234
    a.csv;3;3.345
    Copy of a.csv;1;1.123
    Copy of a.csv;2;2.234
    Copy of a.csv;3;3.345
    If you have more questions, just shoot
    Kind regards,
    - Bjorn -
    Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's
    LabVIEW 5.1 - LabVIEW 2012
    Attachments:
    AppendingCSV.JPG ‏73 KB

  • I tried to play my iTunes and suddenly get an error message that says "The song (name) could not be used because the original file could not be found.  Would you like to locate it now?"  It happens on all my tunes and each one I select ends up with a "?"

    I tried to play my iTunes and suddenly get an error message that says "The song (name) could not be used because the original file could not be found.  Would you like to locate it now?"  It happens on each tune I select and a "?" appears beside the song.  Does this sound familiar to anyone?

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

  • ITunes will no longer play my music, all the albumss are there but it if I click on a song to play it I get a message saying " The song (name of song) could not be played because the original file coul not be found. Would you like to locate it."

    iTunes will no longer play my music, all the albumss are there but it if I click on a song to play it I get a message saying " The song (name of song) could not be played because the original file coul not be found. Would you like to locate it."

    You get this message because  iTunes can’t find the file. This can happen for a number of reasons:
    The song file or a folder in its path was renamed
    The song file or the folder it is in has been moved
    The song file has been deleted
    The device containing the song files e.g. external drive is not accessible or the drive letter has changed.
    Do any of these aply to you?

  • Batch rename files preserving the original file name in metadata

    How can I batch rename files while preserving the original file name in metadata? (Don't want the old file name as part of the new file name)
    (Adobe CS Bridge can do this with some success, but I don't want to be dependant on this software. Results are inconsistent.)

    With a simple terminal script. More details needed, though.

  • Acrobat 5.0 How do I keep the original file name after I have converted a Word doc to PDF?

    MY colleague has a certain setting in Acrobat that allows him to keep the original file name when he converts documents from Word to PDF. Every time I convert Word, Acrobat overwrites the filename and names it "untitled.pdf". I would like to retain the original name and for Acrobat to simply add the .pdf file extension to the original name. How do I do this?

    I have no idea what you are doing for sure. Does your WORD document have a name. I opened a WORD document and selected the Acrobat Distiller printer for AA5, I got the file menu for selecting the name and it was automatically filled in with the DOC changed to PDF. If you are using PDF Maker, then you will need to search there - I removed PDF Maker for AA5 years ago and can't view that part. I see the same types of options in PDF Maker for AA8.1.2 as I saw in the printer for AA5 and guess it is the same. The untitled.pdf suggests that you never saved the original DOC file so it has a name.

  • How to name individual clips without changing the name of the original file...?

    Hi,
    Theres likely to be a really simple solution to this, but i can't find it! I've done my in & out points, i've created a new clip and i'd like to give it a unique name. When i rename the clip the original file name also changes. How can i rename the new clip without changing the original file name?
    Please help,
    Thanks
    Ed

    Either make the clip a subclip or convert it to a new master clip. Both can be done in the Modify menu.

  • Can I create action to Save As...  and change only one character of the original file name?

    I'm working on a group of  files(25-28) at a time. I have to save each one as a photoshop .raw file and change the first character of the file name. the rest of the file name must remain the same. I then close the original file with no changes. I tried to create an action for this. The only problem is that the next file overwrote the file I used to create the action.  Is it possible to creat an action to save as... and keep the file name of the new file but chage the first character to the same one used in the recording?

    Good day!
    I think what you are describing is not possible with Actions.
    Scripting would be an option, but more convenient might be simply saving the files with unchanged names and then edit the names of  the whole bunch in Bridge in one go (Tools > Batch Rename).
    Regards,
    Pfaffenbichler

  • Easy Way To Change The Original File Name??

    I store all my music and videos on iTunes. I just got a AT&T Tilt and I have to use WMP to sync to it. I can't drag and drop iTunes playlists into my media card cause my Tilt uses Windows.
    My main problem with WMP is even though I edit the song/video name, it still syncs over the original file name. If I change the original file name for WMP then I have to rename it for iTunes cause when I go back to iTunes to play the song/video, it says the file is missing. It's a pain
    For example, in my iTunes music foler in My Music, I have a song file named Britney_Pieceofme.mp3. I edit the name of the song and artist to Britney Spears Piece Of Me but when I sync it to my phone, the original file name appears.
    Thanks!

    I think you may need to "look" into the song to see what information is contained in the mp3 tag. WMP automatically sees that information and will store the song at the name in the tag. To solve your problem, you will need an mp3 tag editor (google search) where you can change the tags on your songs, then put them on your Tilt. I think/hope this solves your problem.

  • Uploaded home movies revert to the original file name when added to iTunes?

    I have Home Video files that I have renamed from the original file names.  When I add these files to iTunes, the files revert to the original file name at the time the file was created.  How can I add these files to iTunes with the new file name without having to rename every Home Movie that has been added?

    OK I have done some more work and think i have the issue resolved. The problem lies with file formats specifically .mp4 and .m4v
    I suspect the files you are importing are mp4 files. When I do this i get the same behaviour of file names changing their name after playback. When i convert my files to m4v format and import the issue disappears.

  • Ecxpert Problem in getting the original file name submitted by FTP

    hai,
    when i use the scheduled FTP Application receive mode to receive files from the remote machine, i am not able to get the original file name, Ecxpert itself maintaining it's own file name,
    Even i query the tracking table also i am not able to find the original filename.
    If anybody know how i can able to get the original file name?
    thanks....

    I don't think there is an easy to capture this information. We ended up writing our own FTP tool so we could gather better data. The other problem we had seemed to be sporadic downloads from sites where setting Passive was required.

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • " song name could not be used because the original file could not..."

    Help!
    "The song <blah blah blah> could not be used because the original file could not be found. Would you like to locate it?"
    I tried "locating" it but nothing seemed to work. How do I get the song back to where I can play it again and get it on my iPod?
    Thanks

    Somewhere along the line, you changed the target where your songs are located in your hard drive hence the ITunes library can't find it. It still thinks they are where they were initially.
    Find which folder you put the songs and then do an import to Itunes library

  • On some of my files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?" Then when I click "Locate", I get nothing.

    I'm really dumbfounded on this one and it's driving me bonkers!!!! On some of my music files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    This began to happen when Chuck made playlists2burn on2CD-and then he would delete the playlist; sending all the song files into oblivion. Certain songs have a ! right next to the file name, and as I stated before, i get that error message:
    "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    So I click on "Locate". No help. I get a menu with folders that say "catroot" and other folders which names I cannot remember, but I scroll PAST the file folders, & it's just a bunch of ".DLL" files.....I don't understand what any of the names of the folders mean...it's frustr8ing-coz this is my 2nd iTouch, my 1st one got stolen & I can't afford2buy my music back at this time & i NEVER before had a single problem with losing song file locations.
                  Is there anyone out there who has been through this frustrating game of chasing your tail?....<that's how I feel>
    If so I would be ever so gr8ful if maybe someone with the knowledge would be so kind as 2 tell me how/where 2 retrieve these songs & how to put everything back where it belongs, I would be 4ever gr8ful !!!
    I can't afford 2 replace the songs just like I'm unable 2 buy back my old music from my stolen iTouch....man that was an awesome collection-someday I'll be able 2 afford 2 do that & I would like 2 have all the new music that I paid 4 but cannot find when I got my new iTouch....that would just be  wonderful.
                 I hope someone sees this post that can help me retrieve these files....losing $100.00 of iTunes is a REAL BUMMER!!!!!!
                                                      ThanQ SO very much!
                                                                             [email protected] or [email protected] or [email protected] .
                                                                                               You can also find me on Facebook, my given name is Tiffinie Trimmer, &
                                                                                                that's my Facebook "handle".    ThanQ 4 taking the time 2 read all of this!
                                                                                                hope 2 get a reply someday....I'll B checking all my emails & my Facebook, as well
                                                                                                as marking this page in my FAVORITES so I can find it fast! Take Care!!!

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

  • Moved iTunes library to an ext hard drive to make space on my int drive... Followed steps from apple.  Now I cannot access my music... It says: "File could not be used because the original file cannot be found.  Would you like to locate it?"

    Moved iTunes library to an ext hard drive to make space on my int drive... Followed steps from apple.  Now I cannot access my music... It says: "File could not be used because the original file cannot be found.  Would you like to locate it?"
    I moved my iTunes library to my external hard drive some time ago and I followed the directions listed here on the apple support page.  It did copy my library and now is on my hard drive... I can open iTunes and use it to sync all of my devices but I would like to play my music... I can see all of my music files but can not play them if I click on an album or song it says the following:  "(file name) could not be used because the original file cannot be found.  Would you like to locate it?"  I click locate but do not know where to go from there?  I need a way to access all files and not to hunt down one at a time on my hard drive... I am pretty sure I deleted the original library to make space on my internal drive which was the reason for moving it.  I have tried and tried to fix it and do not have a lot of time to do so with a one and two year old at my house who do not like it whenI sit down at my computer.  What to do???  Any help is much appreciated!!!

    See Make a split library portable. Move all of the bits of the library together in the the correct shape and it should work. Or undo exactly what you did and then start over.
    If you're a former Windows user don't try merging two folders together that have the same name by dropping one into the same folders as the other, as that goes badly on a Mac.
    tt2

Maybe you are looking for