File Adapter : Dynamic Target Directory

Hi EveryBody,
I have an IDOC to File Scenario in which based on some field value X in IDOC i need to send the file to Different locations under the same FTP Server.
For Example : if X = 01 then Target folder T1
                        X = 02 then Target folder T2.
Can somebody help me out on the same.Possibly this can be done by Dynamic Configuration.Can somebody send me some links.
Regards,
Zabiulla

Hi,
First of all I would suggest to avoid the mail communications for the query.
Its against the SDN rules.
please read [Rules of Engagement|/thread/117188 [original link is broken];.
About Solution, you need not have to go for Dynamic Target Directory
You can use the Variable substitution concept here.
In the Target directory pass the %Var1%
and use Var1 ---> payload:<fieldName>
Refer to the last part of this link to understand this better,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
For dynamic configuration you can also refer below link
Dynamic configuration of Receiver FTP File channel
Thanks
Swarup

Similar Messages

  • Dyanamic Configuration at receiver file adapter determine target directory

    Hi Experts,
    I have a requirement to determine the target directory during runtime.
    From the source side one particular field determine the Target directory where you need to place file
    ECC - PI - File adapter - this is the scenario
    In target side 3 directories in the same server . but the directory should determine from source fields - werks
    As I am new to PI Please describe the procedure in detail.
    Thanks in advance.
    Kevin

    Hi Kevin,
    Use the below UDF and map to the rootnode in the message mapping.
    public String GetFileName(Container container){
    DynamicConfiguration conf = (DynamicConfiguration) 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; 
    In the Advanced tab of the File adapter, check the option Adapter Specific Message Attributes. Under that, check the Filename option.
    This would get the fieldname in the target filename.
    Check the below link:
    /people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot
    http://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/frameset.htm
    /people/shabarish.vijayakumar/blog/2007/07/26/troubleshooting-the-file-adapter-last-updated-on-02-july10
    Thanks,

  • XI3.0 File Adapter - Changing target directory at runtime

    Hi all,
    I have a XI3.0 running and I'm using the file adapter of SAP Basis 7.00. I'm trying to change the target directory at runtime, as I already did with the file name. The file name could be changed using the DynamicConfiguration, but this does not work for the directory. In help.sap I found the hint to use the variable substitution of the communication channel. I did not get it running, but it also does not solve my problem since I don't want to get the value for the target directory from the message header, but from a SAP IS-U system.
    Can anybody help me to solve this problem?

    Hi,
    while using variable substitution, did u set the indicator for create Directory:
    <i>If the adapter is to create the target directory, if it doesn't already exist then set the indicator Create Target Directory.
    If the indicator is not set and the target directory doesn't already exist the adapter returns an error.</i>
    Regards
    Vijaya

  • Configure Sender File adapter dynamically

    Hi,
    I need to configure the sender file adapter dynamically. Ex: I will be providing the src dir , file name etc dynamically. I think this is not possible using module because module gets executed after file is picked (in my case file dir and file names need to be determined dynamically). I even don't won't to use directory API for craeting my file sender comm channel. Is there any other way to achive this.
    Regards,
    Rakesh

    Hi Rakesh,
         what is the Operating system of the PI server? Could you please kindly explain what conditions determine filename and source directory? I do not think there is anyway you can determine src file and dir names dynamically in PI.
    Here is what you can try.
    PI server is on windows system u need batch file. If its on unix or Linux you need scripts. Now what you have to do is place all files in a directory. Here the script/batch file will run continuously in background. Once it gets files it will rename files based on file content or file name then move them in different directories as per your conditions. your interface must have multiple communication channels and sender agreement (with diffrent parties) which will pick up those files from these directories.
    The name of directories will be fixed in each channel.
    regards
    Anupam

  • Unable to  convert the file name in Target directory

    Dear Experts,
    Currently iam facing a problem with some files.my interface is a File to file .As per the interface the sender will pick the flatfiles from source directory which the file name was BNP_NE201.txt once my file reached to target directory the name of the file willrenamed as VENDOR_Payment.NE201 automatically  for this they have done some OS level script in receiver communication channel of the first interface which we have added "un operating system command after message processing" in processing parameters tab.again one more sender comm channel wil pick the file from first target directory which is having naming  convesion of "VENDOR_Payment.NE201 " and post it to target. all the two interfaces are file to file (NFS) . for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
    from our side i check every thing .could you please suggest me the way to approch
    Reagrs,
    Kiran tanuku

    >> for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
    You need to wait until the file is converted. After when it is converted then the second interface sender communication channel will pick the files.
    What do u mean by unable to convert?
    Is it unable to do the content conversion? if so then check the data as you said that it sometimes it works fine.
    > The best approach is to change the name of the file in the receiver communciation channel instead of using a script.
    Thanks,

  • Error: File adapter dynamic directory not safe with subdirectories

    Hi,
    I'm using variable substitution to determine the destination directory for my RFC->File scenario
    In my RFC I have a tag called <PATH> that contains the full target path. If that path doesn't have subdirectories the variable substitution works perfect, for example:
    <PATH>directory1</PATH>
    Then in File adapter I have %var1% with the value of PATH and it works.
    But if I want to add subdirectories on the path, for example <PATH>directory1/subd2/subd5</PATH> the solution doesn't work.
    That's the error that I get:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: java.text.ParseException: Security violation encountered during variable substitution: Content of variable var1 is not safe: directory1/subd2/subd5
    How can I access to that directory?

    Hi Marshal,
    From help.sap:
    To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters u201C/u201C, u201C\u201C, and u201C..u201C.
    Carlos

  • Receiver File adapter: dynamic folder name based on file name

    Hi there,
    is it possible to set up one communication channel that will use different target folders based on file name?
    E.g.
    File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
    File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
    I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
    Thanks.

    If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
    In your abap mapping:
      DATA l_record type mpp_dynamic.
      l_record-namespace = 'http://sap.com/xi/XI/System/File'.
      l_record-name = 'FileName'.
      l_record-value = "your filename"
      dynamic_configuration->add_record( l_record ).
      l_record-namespace = 'http://sap.com/xi/XI/System/File'.
      l_record-name = 'Directory'.
      l_record-value = "your directory ".
      dynamic_configuration->add_record( l_record ).
    Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
    Regards,
    Carme.

  • File Adapter: Dynamic file name

    Hello,
    I would like to use a filename like this:
    Name.<DOCNUM>.Direction.<Timestamp>
    For DOCNUM I use variable substitution. Works fine.
    For <Timestamp> I need a different format as the timestamp function
    in file adapter create. So I try to set up my timestamp in mapping like
    dynamic file name:
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Timestamp");
    conf.put(key1, a);
    Input a is date function which creates my desired timestamp format. In file adapter I try this:
    Name.%DOCNUM%.Direction.%Timestamp%
    or
    Name.%DOCNUM%.Direction.Timestamp
    or
    Timestamp
    all doesn't work for Timestamp.
    So is there a possibility to configure a dynamic filename like this???
    Is there a possibility to access dynamic configuration variables in dynamic filename except
    the known for filename and directory??
    thanks
    chris
    Edited by: Christian Riekenberg on Mar 10, 2009 4:02 PM
    Edited by: Christian Riekenberg on Mar 10, 2009 4:05 PM

    your file name needs to be
    Name.<DOCNUM>.Direction.<Timestamp>
    dont use variable substitution. use only dynamic configuration and set the file name
    introduce a logic that will create the string
    Name.<DOCNUM>.Direction.<Timestamp>
    eg. String filename = "Name" + var_docnum + "Direction" + var_timestamp;
    then use the dynamic conf code to set the file name and use adapter specific properties in you adapter to retrieve it.
    Ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • File Adapter dynamic configuration

    Hi,
    I would like to know how to configure location,polling frequency, file name dynamically at runtime.?
    Is there any possibility to read configuration/property file at time?
    Regards,
    Govind

    Which SOA Suite Version you are using ? You can change the directory and file details. Pls refer Re: Get File name using File Adapter Hope that will help you.

  • File to file scenario..............file lost if target directory incorrect?

    hi forum experts,
    i have a file to file scceanrio....without BPM....
    there is only one mapping ...in the receiver determination......
    the problem is........
    when in the receiver communication channel....in the <target directory>....i give something absurd.....e.g. '-', the file cant be put to the desired directory...
    and the file is lost.............moreover nowhere in the rwb i can see what the error is.......in rwb it shows file delivered successfully........
    now how can i retrive the lost messgae.....how can i resend the message from rwb or MDT............
    is it possible from MDT to resend the message payload again????
    pls help

    Dhar,
    Is this is development or production? Also why you have given the target direcotry as '-' ?  Is this your requirement?
    Anyway you can post the same message once again from RWB. Since it is file to file scenario you can post from RWB.
    Go to sxmb_moni and open your message. From the source payload right click and select view source. Then copy this payload and go to RWD ---> Adapter Engine ---> Test Message ---> Here you give your Source business system, Target business sytem and all the parameters. Also you paste the payload here. Also give your user name and password and select Quality of service BE. Then send the message. You will see a new message in sxmb_moni.
    Also would recommend to give a name for target directory.
    Check this weblog for some help on this:
    /people/michal.krawczyk2/blog/2005/08/25/xi-sending-a-message-without-the-use-of-an-adapter-not-possible
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    ---Satish

  • Dynamic target directory with variable substitution

    Hi everyone.
    I'm trying to save a file in a folder with receiver adapter.
    This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not safe'
    Does anybody have done a variable substituion for output directory receiver file adapter?
    Regards,
    Inigo.

    Hi,
    Check this links,
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Regards,
    Phani

  • Sender File Adapter - Dynamic Filename?

    Dear All,
    I have a simple requirement to retrieve a file named "XXX_ddmmyy" from an FTP site. The FTP site administrator will place a new file everyday. The date is part of the filename.
    I can find a lot of information on how to set the Filename for a "Receiver File Adapter", but none about dynamically setting of the filename for a "Sender File Adapter".
    Can you help please?
    Kind Regards
    Farshad

    Hi,
    You have mentioned over here that the requirement is to get the file "XXX_ddmmyy" from an FTP site.
    Is that site strictly for keeping files related to your requirement only or lot of other files are also being placed???
    If its strictly related to your requirement then you can use the filename "*.extension" and set the processing mode as "delete" so that once the File Adapter picks the file it will be automatically deleted.
    But here disadvantage is that the file wont be no longer present in FTP site once it is picked by File adapter.
    Thanks,
    Lekshmi.

  • Receiver File Adapter - Dynamic FTP Server Address

    Hi,  I would like to pass the FTP Server address to the Receiver File Adapter as an parameter.  Is this possible and if so what Name Space / Parametr Names add to the Product to define these values.
    Thanks
    Andre

    Hi Andre,
    If you have your server as a part of your payload, thendynamic file server generation concept can be done is as follows. 
    In your server name field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • How to create a write operation in file adapter dynamically in to a folder.

    Hi all
    i want to explain my scenario...
    i am giving input to file adpter which is having read operation,and i am giving that input to an human work flow.i had two operations reject and resubmit in my task flow...i am editing the task with some changes...and resubmiting the task from the oracle bpm worklist.......now how can i give that task to again my input folder.....
    and another question is,
    if i am using three file adpters with 3 differnt folder structure having read operations.and i am giving only one file to one file adapter.and i am giving it to human work flow and i am editing it and i have to resubmit the file to the input folder.....so i i have to give back to input folder dynamically(with out hard coding the folder structure).....How can i give ?????
    so any one can help me....please...
    Thanks in advance...
    varma.

    ya...its gd....but i had a problem in my scenariou....
    i used this concept as a error handling frame work....that means
    i had so many composites which take purchase order as its input from a file adapter........if the input order differs from my xsd,i populated that input as a error file in another folder using some fault handlers... and i am giving that folder to human work flow and i a m editing that task and i am resubmiting it...so that it should go to the input folder of my composites as a input again...so how to differ ,for which composite i have to give as this task as input again.....dynamically it should vary in ...........
    please help me....
    thanks in advance....
    varma

  • Setting the File Adapter Sender Source Directory...

    Good morning, Experts
    We have 2 sender file adapter communication channels in XI 7.0. Source directories for each are as follows:
    Channel A - //757spgmr16-xp.sauder.com/SAP
    Channel B - //devqas.sauder.com/ROOTBIN
    Channel A works.  Channel B does not.  It returns "Configured source directory '//devqas.sauder.com/ROOTBIN' does not exist".  When I remote into the XI box as the administrator I can open a Windows Explorer window and can see both of these source folders.
    What user ID is used to access the NFS for the communication channel???
    Any help you could give would be greatly appreciated.
    Thanks,
    Chad

    Is the integration engine running in a service on the XI server???  There are a number of SAP labelled services.  Some are started with the log on of "Local system", some with the administrator account and then some with an ID of "SAPServicePID".
    My guess here is that possibly this SAPServicePID user is running the integration engine and does not have permissions to the source directory???  Could this be the case???
    Can somebody tell me the name of the service for the integration???

Maybe you are looking for

  • How to compress Segment/Table to 1 extent in Oracle 8.0.6?

    The best strategy I find to compress a table's extent is to: 1) export the table 2) drop the table 3) import the table. However, this is proving to be very problematic. When you export a table with constraints=y, it does not include the foreign key c

  • Developing 3rd party UWL Connectors for People soft system or other Java sy

    Hi Everyone We have one requirement that is u201CDeveloping 3rd party UWL Connectors for People soft system or other Java systemu201D and get the workflows from those system and display in portal though UWL. We used u201CUWL Custom Connector APIu201D

  • SRM 7 EHP1

    Hi All, we would like to connect SRM 7 EHP1 with ECC6 EHP5 using XI. extended classic self service procurement. Pls guide us connecting SRM with ECC using PI. Any Mapping guide for PI and Config settings for SRM side. Abdul raheem

  • Scripting buttons for web use

    The title is pretty self explanatory. I have a simple map that I have created buttons for..when the user mouses over ares of the map they are hilighted...when they click on a section it should redirect them to a certain URL but I am having no success

  • How to add two same components to jsplitpane?

    I want to add same jfilechooser as left and right component of jsplitpane. But when i am adding, it doesn't shows me either of the component(eg blank jsplitpane). I am Sir plz give me any solution to add same component to jsplitpane.