Dynamic File and Directory Name without Mapping

Hello Experts,
We have following requirement:
1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system.
2) On source side ,there would be only one folder for all types of files(around 20),but on target side,there would be one folder for each kind of file(20 folders)
3) File name should be same on the target side but target directory should be selected based on file name.
I have gone through a number of posts related to similar requirements and hence,sorry for a new post but I am not yet able to find a solution to this.
I could understand,this can be achieved using DynamicConfiguration UDF .
But I have no possibility to have mapping in my scenario.It would just be a pass through scenario.
Can anyone please suggest a solution to this?
Thanks.
Regards,
Shweta

Hello,
Thanks a lot for suggesting solution to this problem.
I could achieve this using following Java mapping:
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.text.*;
import java.util.*;
public class GetDynamicConfiguration implements StreamTransformation {
    private Map param;
    public void setParameter(Map map1) {
        this.param = map1;
    public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
        try {
               AbstractTrace  trace = null;
            // a) Set ouput File name
            String directory=null;
               trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
            param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
            DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
            DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
               DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
            String filename =conf.get(key);
            conf.put(key, filename);
               trace.addInfo("File name is "+filename);
            if(filename.equals("in.txt"))
            directory = "/home/ftpxi/in";
               if(filename.equals("test.txt"))
               directory = "/home/ftpxi/in/test";
               if(filename.equals("shweta27.txt"))
               directory = "/home/ftpxi/in/test";
               trace.addInfo("Directory name is "+directory);
               conf.put(key1, directory);
            // b) Just copy input file to output file
            byte[] b = new byte[inputstream.available()];
            inputstream.read(b);
            outputstream.write(b);
        } catch (Exception exception) {
            exception.printStackTrace();
Thanks again.
Regards,
Shweta

Similar Messages

  • File and directory names with Danish characters

    I have installed the Novell Client v2.0 for Linux on my Open Suse 10.3. The Client is connecting to my Netware servers (6.0 & 6.5) without any problems...
    There is one problem... Filenames and directory names with the Danish , & (ae, oe & aa), e.g the filename bger.doc (bger = books) is shown as b. and when clicking the file the file disappears from the file list. It seems to be the same problem with the German (umlaub).
    What to do?
    /Michael

    Originally Posted by J.H.M. Dassen (Ray)
    mimo <[email protected]> wrote:
    > There is one problem... Filenames and directory names with the Danish ,
    > & (ae, oe & aa), e.g the filename bger.doc (bger = books) is shown as
    > b. and when clicking the file the file disappears from the file list. It
    > seems to be the same problem with the German (umlaub). What to do?
    As far as I know, the Novell Client for Linux expects that file and
    directory names use the UTF-8 encoding and does not support a traditional
    8-bit encoding like ISO 8859-1. Try changing the encoding of file and
    directory names to UTF-8 as described in
    SDB:Converting Files or File Names to UTF-8 Encoding - openSUSE
    HTH,
    Ray Dassen
    Technical Support Engineer, EMEA Services Center, Novell Technical Services
    Novell, Inc. Software for the Open Enterprise Software for the Open Enterprise
    Seems a good hint. When I create a folder or file from within SUSE using an "Umlaut" everything is OK and NCL 2.0 displays them correctly as they are UTF-8 formatted.
    The proposed tool is no solution: one cannot convert folders or files that one cannot see (does it work for folders at all?). Maybe a windows tool would work because one could search for all files or folders with "Umlaute" and convert them. Other options?

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Prevent using special characters in file and folder names?

    I've recently begun adding windows clients to my network. In doing so, I've found that on my file shares from OS X server, the windows clients are unable to see files and folders which have names containing special characters such as / ? < > \ : * | ”
    Unfortunately my accounting department has been creating files with these characters in their names for several years. I would like to find if there is a way to prevent them from using a defined set of characters in the file and folder names to prevent them from "accidentally" doing so in the future.
    I've found that by turning off streams support on SMB in OS X server, that my windows clients can at least see that a file or folder should exist, albeit with a corrupted file name. Removing the special characters from these names allows the proper name to become visible and the file accessible.
    Any info would be greatly appreciated.

    (_seb_) wrote:
    > Gary White wrote:
    >> On Sun, 19 Nov 2006 19:15:04 +0100, "(_seb_)"
    <[email protected]> wrote:
    >>
    >>> "ça alors: it's a déjà-vu"
    >>>
    >>> How can I encode this so it's valid as a
    directory name, yet can be
    >>> displayed as intended when the name is output to
    the page.
    >>> urlencode() does not do the job, neither does
    htmlentities()...
    >>
    >>
    >> What's wrong with:
    >>
    >> $l="ça alors: it's a déjà-vu";
    >> print urlencode($l)."<br>\n";
    >> print htmlspecialchars($l);
    >>
    >> Gary
    >
    >
    > I know that, but what is the name of the directory? It
    has to be a real
    > directory name, not a string stored somewhere.
    >
    > What's a valid encoding for a directory named "ça
    alors: it's a
    > déjà-vu"? I can call a folder like this on my
    Mac, but it won't work on
    > any server...
    >
    >
    >
    PS: basically it's not a url encoding issue.
    I can url encode "ça alors: it's a déjà-vu",
    and pass it in a url query string. But my issue is not
    with an url query string, it's with an actual URL, that is,
    the actual name of the directory. It
    can't be "ça alors: it's a déjà-vu". But I
    want to allow the user to name their directory like that
    if they want. So I need a way to encode this into characters
    that can be used for an actual
    directory on the server.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • Error 127: The specified file or directory name is invalid

    Hello,
    I am trying, for the first time, to Groom a users home directory. I had created user Home directory policy and have added vault and groom...

    On 5/14/2013 7:16 AM, nwadmsitn wrote:
    >
    > Hi,
    >
    > I'm trying to evaluate File Reporter. I have installed the agent on a
    > OES11 box. This agent is acting as my proxy agent.
    >
    > Then i setup a policie to scan a volume on 2 differents server. One is
    > OES11, the other is OES2.
    >
    > When i launch my policies i have very differents result :
    > - Volume Free Space : After 5 attempts finally it is working
    > -File System DATA : I have most of the time this error : (127) - The
    > specified file or directory name is invalid. Sometimes Operation is
    > successfull but in the reports i have only data for 1 of the 2 volume
    > and only for 2 directories
    >
    > In the log file of the nfr proxy agent i have this kind of error :
    > 01 2013-05-14 13:00:29 7200 3 0006 5953 7f674b5e0700
    > SRSScanAndCollectFileSystemDataService::FinalizeSc anDataEntry() - Worker
    > thread encountered an error and is exiting, Scan ID = "18", Result = 0.
    >
    > Can someone help me ?
    >
    > Stephane
    >
    >
    Stephane,
    Just to clarify a few things:
    1. Do you get these results for both scan targets? Or only a proxied
    scan of the OES11 or OES2 volume?
    2. What sort of volumes are being scanned? NSS? AFP? NCP? What's the
    underlying Linux filesystem type, if applicable?
    Thanks for helping us understand your problem better.
    - NFMS Support Team

  • File and Directory Maintenance on OSX Server

    Are there any special considerations for using file and directory maintenance utilities such as Disk Warrior or TechTool, etc. when dealing with OSX Server, or can it be handled just like any other volume.
    We have all of our data and our user home directories on the server and I would like to run some miantenance on them.
    Thanks.

    I am no expert on disk utilities.
    Personally, I just have a separate 5G partition with a minimal OSX which I boot from once a month (or before a server update) and run Disk Repair & Repair Permissions from.
    As far as I know, there is nothing going on on the server that is not going on on a 'normal' OSX machine (at file level mode). The OSX unix offering is miles from the previous OS9 model where the likes of Norton was almost mandatory. The built-in 'periodic' scripts and disk utility 'repair' (see "man fsck" in Terminal) all run at unix level, and have done for years, even before Apple II days!
    Although I have both Disk Warrior & TechTool, I don't use them except in an 'emergency' (otherwise called: "try anything").
    I would be interested in any other comments though.
    -david

  • File and directory permissions

    We are running OSX 10.7 Lion on a Mac Pro 1,1 IN RAID. We are using this system als fileserver. Since last year it came to our attention that there where problems with the permissions on the files and directories (they seem corrupted). I do not mean system files but the files we stored on this server. When I look at random file permissions I get a whole list of users etc. A lot of duplicate users are there and also there are some entries in the list saying 'fetching'.
    We use the server admin tool to manage groups and users.
    This is what we have done so far:
    - Try to repair permissions through terminal (because of RAID configuration)
    - Propogate permissions through server app
    - Resetpassword trick (restart cmd+R / terminal / resetpassword)
    Can anyone tell me how to get this working 'clean' again? is there a way to reset all files according to the workgroup/user settings in the server app?

    Sounds a bit like the temp files are not being 'closed' after being written
    to or read by Labview. If you are using the advanced file vi's make sure
    that they are closed afterwards.
    If the OS assumes they are open then it will not allow deletion etc even
    outside of Labview.
    bubucis wrote in message <7kv2kl$3flk$[email protected]>...
    >Hello!
    >
    >Does anybody know how Labview deals with file and directory permission
    >locking under WinNT.
    >I have a following problem. There is a main VI running in a state machine
    >mode and it fires up a SubVI that has a bunch of SubVIs. One of these
    >SubVIs are creating a temporary directory and files that I want to delete
    >once everything is over. However I always get a file permission error when
    >trying to delete those f
    iles, also when using Explorer and trying to delete
    >those files I get a file sharing error. This happens even when main VI has
    >been stopped. How comes LabVIEW does not unlock that file and directory.
    >Rather annoying!
    >Thanks for you help.
    >
    >Reinis Kanders
    >
    >

  • My utorrent suddenly lost all the torrent files and just runs without working

    hello,
    my utorrent client suddenly lost all the torrent files and just run without working I MEAN DOES TAKE ANY NEW TORRENT FILE TO DOWNLOAD.
    i also Install the bittorrent client and afterwhile did the same
    does anyone knows why?
    thanks in advance

    Based on some of the Yosemite issues - important lesson here - check to see if all of your software has verified it can run with the upgrade.

  • Problems with spaces in file or directory names and Word.exe

    Hi
    I'm trying to open a file with Word from my java aplication, and I have a problem with some file/directory names.
    I have this
    String cmd = "c:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" + " " + path;
    try {
    Runtime.getRuntime().exec(cmd);
    } catch (Exception errorea){ }
    Here is what happens:
    if path is something like this: "c:\people\info.doc" , there's no problem, Word opens the document, but if path contains blank spaces somewhere, it doesn't work. For example:
    path = "c:\Documents and Settings\info.doc"
    path = "c:\Hi everybody\info.doc"
    path = "c:\tests\test results.doc"
    with the above examples it doesn't work :( Word tries to open "c:\Documents", "c:\Hi" or "c:\tests\test".
    Can anyone help? thanx a lot ! : )

    Hint: use the variant Runtime.exec(String[] args).
    Create a command array, with each token in a separate argument. The entire filename with spaces goes into one argument.

  • Get filename and directory name during runtime

    Hi guys,
    I am developing a file to file interface without content conversion, just a simple file transfer from one ftp server to another. I have to read the same filename (invent.txt) from multiple folders (mstransfer/M01/IN1, mstransfer/M02/IN1, mstransfer/M03/IN1....) that represent different stores and transfer it as it is with the same name to exactly the same directory name in the target ftp location.
    My problem is found inside a dummy mapping that I have created in order to specify the target directory and the name of the file. I am doing the following:
    A) A Java UDF to specify the filename
    trace = container.getTrace();
    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);
    trace.addWarning("filename = "+filename);
    conf.put(key, filename);
    return "";
    //return filename;
    B) A Java UDF to specify the directory name
       //write your code here
    trace = container.getTrace();
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String directory  = conf.get(key);
    trace.addWarning("directory before = "+directory);
    directory = "/usr/sap/trans"+directory;
    trace.addWarning("directory after = "+directory);
    conf.put(key, directory);
    return "";
    //return "/usr/sap/trans"+directory;
    In receiver file adapter I do not specify neither a filename nor a target directory.
    When I am testing it, I always get a mapping runtime error.
    Any ideas?
    --Evaggelos

    Guys,
    First of all, I am doing an end to end testing, i.e. I let the FTP adapter pick the file up and another FTP adapter delivers the file to target folder. I am definitely not testing the mapping in mapping editor.
    I get the error in Request message mapping (pipeline step, which I can see in SXMB_MONI transaction) which is a dummy mapping between two message types that I have created and are based on two data types with two fields each.
    The UDF's that I have created go in-between the source and target fileds of the message types/data types.
    The error that I see in the trace section of the XML message in SXMB_MONI is the following:
    "<Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_G_SRS_FileTransfer_MNS_</Trace>
      <Trace level="1" type="T">java.lang.NullPointerException at com.sap.aii.mappingtool.tf3.AMappingProgram.exceptionCaught$(AMappingProgram.java:59) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:182) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:149) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:91) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at"
    I have included some trace.addWarning() lines in Java code to help me debug my code, but I cannot see them anywhere inside the trace to be getting executed.
    I will try Bhavesh's idea and I will write the code in the Java Section of my message mapping ( either Intialization or Destrcution ) section.

  • Dynamic FileName and Directory - UDF

    My scenario is to get Target Directory Name based on part of Filename. How can I do that using UDF. I will select adapter specific parametrs and like to change using UDF. TO achive this I will create a dummy field names in the target structure. Can someone let give me UDF code?.
    For Example: Source FileName : SD00123456Prod.csv
    Target Directory Should be /Sales/
    Target File: Prod.csv
    Thanks for any help.

    I changed function this time. I took exact coy of Michals Blog.
    Function:
    public String SourceFileName(Container container){
    container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create
    ("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Now the error when activate message mapping:
    Activation of the change list canceled Check result for Message Mapping Source_2_Target | http://test.com:  Starting compilation  Source code has syntax error:  /usr/sap/DPI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map36d73f104e5e11db977f001125a56eca/source/com/sap/xi/tf/_Source_2_Target_.java:55: cannot resolve symbol symbol : variable conf location: class com.sap.xi.tf._Source_2_Target_ String ourSourceFileName = conf.get(key); ^ 1 error

  • Long file and path names

    I have a dialog window where users can choose a file, the name and path of which is then displayed. The field where this is displayed isn't big enough to hold the typical long path names found on for example Windows. I was wondering if there is a standardized way of shortening/abbreviating the full path name already written up somewhere? I want my program to be portable ... I looked at how MS Word does it on Windows, and I could write a specialized function to copy that, but then it wouldn't work on other systems that use different path conventions, and I would like to keep the generality if possible. On word they do something like this
    C:/.../final directory/filename

    Kramis wrote:
    sure, that much I understand, but I wouldn't know how to create that sort of string from an arbitrary path name of unknown format. In Windows, for example, I could take the first three characters and then ..., but that might not work globally. The questions is about parsing and converting a path name from an arbitrary system.I'd just split the path into its 'final directory name' and 'file name' (with the universal Java path seperator of (/)), and stick '...' in front of it.
    So any path such as C:/blah/blah/blah/endpath/filename or /unix/path/blah/blah/endpath/filename would become .../endpath/filename regardless of platform.

  • Standby Redo Log Files and Directory Structure in Standby Site

    Hi Guru's
    I just want to confirm, i know that if the Directory structure is different i need to mention these 2 parameter in pfile
    on primary site:
    DB_CONVERT_DATAFILE='standby','primary'
    LOG_CONVERT_DATAFILE='standby','primary'
    On secondary Site:
    DB_CONVERT_DATAFILE='primary','standby'
    LOG_CONVERT_DATAFILE='primary','standby'
    But i want to confirm this wheather i need to issue the complete path of the directory in both the above paramtere:
    like:
    DB_CONVERT_DATAFILE='/u01/oracle/app/oracle/oradata/standby','/u01/oracle/app/oracle/oradata/primary'
    LOG_CONVERT_DATAFILE='/u01/oracle/app/oracle/oradata/standby','/u01/oracle/app/oracle/oradata/primary'
    Second Confusion:-
    After transferring Redo Standby log files created on primary and taken to standby on the above mentioned directory structure and after restoring the backup of primary db alongwith the standby control file will not impact the physical standby redo log placed on the above mentioned location.
    Thanks in advance for your help

    Hello,
    Regarding your 1st question, you need to provide the complete path and not just the directory name.
    On the standby:
    db_file_name_convert='<Full path of the datafiles on primary server>','<full path of the datafiles to be stored on the standby server>';
    log_file_name_convert='<Full path of the redo logfiles on primary server>','<full path of the redo logfiles on the standby server>';
    Second Confusion:-
    After transferring Redo Standby log files created on primary and taken to standby on the above mentioned directory structure and after restoring the backup of primary db alongwith the standby control file will not impact the physical standby redo log placed on the above mentioned location.
    How are you creating the standby database ? Using RMAN duplicate or through the restore/recovery options ?
    You can create the standby redo logs later.
    Regards,
    Shivananda

  • File to XI scenarion without mapping

    HI All,
    MY REQUIREMENT:
    1. Need to read the data from FILE .
    2. pass the values to a BAPI structure in ECC Without any mapping
    QUESTIONS:
    1. Is it possible to complete the  scenario without mapping in XI.
    2. If possible how.
    Could any one help me how to achieve this
    Than you,
    Harsha P

    My source data structure is same as BAPI.
    We have created data types ,message types and Service interfaces for SENDER in ESR.
    But our Issues.
    1. Do we need to create Receiver Interface Objects.
    If yes How (In our scenario receiver is BAPI)
    import RFC under imported objects in esr
    2. What are the configurations we need to do in ID for SENDER and RECEIVER.
    coming to id:
    create everything like
    communication channels for sender as file and receiver as RFC.
    create Agrrements for sender and receiver.
    create Receiver determination and interface determination.
    Edited by: bhavanisankar.solasu on Feb 21, 2012 4:17 PM

  • Both file and directory path selection

    Hi,
    Is it possible to select both file path and directory path from one parameter using F4?If yes how?
    Thanks.
    Edited by: Ginger on Oct 5, 2009 7:51 AM

    >
    Ginger wrote:
    > No...file can be anywhere....file path selection means will have file name(c:\abc.txt) and directory selection means only select 'C:\'
    > from which files can be selected.
    >
    > Now I want to enable both the options in one parameter path.Is it possible?
    AFAIK, it is not possible.
    But you can try a workaround though :-P
    Make two radio-buttons:
    1. Select File (rb_file)
    2. Select Directory (rb_dir)
    Then based on the radio-button call the respective method
    IF RB_FILE = 'X'.
    Call Method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    ELSEIF RB_DIR = 'X'.
    Call Method CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
    ENDIF.
    BR,
    Suhas

Maybe you are looking for

  • Mac Pro & Boot Camp 1.2

    I know that BC 1.2 does no have support, but i want to know if someone has successfully installed Windows Vista on a Mac Pro with a GeForce 7300 graphics card? I managed to install Windows Vista, but there are 3 devices in the device manager that can

  • Some D800 Raw files not previewing

    Not sure what the problem is, but every so often, I'll have some D800 Raw files (14 bit, lossless compressed), and the .NEF logo will appear sideways in the preview panel. I can only see the image if I open it up in camera raw or Photoshop. Not sure

  • I have lost the tools, file, menu at the top tried reloading still wont come back how do i get it back

    while customizing my settings i lost the menu at the top file, edit view , favorites, tools, etc. even if i delete mozilla and reload it i cant get it back

  • Oracle Mobile Server 11GR2

    Hi all, currently we are using Oracle Mobile server 10.3.0.3 and would like move to Oracle Mobile Server 11GR2. But before going to that quite new area would like to get some feedback about that version/release as is critical for us to be sure that c

  • Issue In Task List, When I select any SP13 task item its updating task status to "Completed" automatically

    Hi Guys, A strange issue I am facing in SharePoint 2013 task list. When I just select any task its updated the task status automatically to "Completed". When I unselect task its updated task status to "Not Started" automatically. I don't know why its