Dynamically generate terget directory in receiver FTP adapter

Hi guys,
I'm trying to set up a scenario where the file will be placed into a terget directiry based on values from the incoming message. I can't use variable substitution as my target message does not contain the needed value, so I'm trying to set up a dynamic configuration in an UDF. Unfortunately, this is not working.. Any ideas, what could be wrong? The receiver FTP adapter always just takes values from it's configuration. It doesn't help when I try to change it in mapping.
This is the java map code in the UDF:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, a);
conf.put(key2, "tfilename.txt");
return "";
Thanks a lot for any help,
Olian

Hi,
use below code it will work fine
DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters().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 a=conf.get(key);
String b=conf.get(key1);
var1 = a+b; ;
return var1;
map this udf to root element of your receiver structure.
Regards,
Raj

Similar Messages

  • 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

  • Prerequisites for Sender and Receiver FTP adapter

    Hi Experts,
    I am new to PI and configuring simple file to file scenario. I need to know the prerequsites for sender and receiver FTP adapter. Scenario is System A -> XI -> System B .
    What I want to know is:
    1> What ports need to be opened?
    2> Any service that I need to activate?
    3> Do I need to install FTP server in any of the machine?
    If I have missed something, please add.
    Br,
    Nilz

    Hi,
    1> What ports need to be opened?
    mentioned in below link as said its 21.
    2> Any service that I need to activate?
    No
    3> Do I need to install FTP server in any of the machine?
    THere are two ways by which u can pick ur file.
    1) NFS by which u can put the file on XI appplication directory and pick up ur file.
    2) FTP u have to put ur file on FYP server and XI will pick up the file from there. U can use freeware FTP and install it on ur Desktop search on goolge u will get ti FTP installtion.
    refer the below configuration requirement for FIle adapter.
    http://help.sap.com/saphelp_nw04/helpdata/en/69/a6fb3fea9df028e10000000a1550b0/frameset.htm
    ALso refer the end to end file to file scenario.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/flatFILETOFLATFILE&
    chirag

  • When to use "Use Temporary File" in receiver FTP adapter

    Hi Experts,
    I have nerver used "Use Temprary File" as the "Write Mode" in receiver ftp adapter.
    I want to knwo under what kind of requirment we should use this option?
    Thanks in advance.
    Best Regards,

    Hi Aditya
    Usually it's advisable to use "use temporary file" as write mode when you want to avoid your file to be picked up by receiver while PI channel is still writing it.
    Obviously larger the file, more chances you have that this issue could occur.
    If you select the "use temporary file", XI will write the content to a temporary file with another name of your choice and only once writing has finished it will rename it to the actual name setup in the "file name scheme".
    Regards,
    Giuseppe

  • Receiver FTP Adapter File Size Splitting

    Hi,
    I am receiving an IDoc from R/3 into XI.
    I then map this IDoc into an xml file and use a receiver ftp adapter to drop the files onto a ftp server.
    Is there anyway, that I can use the adapter to split the message interface into smaller files.  For example, if I were to ftp the message interface into 1 file, the file size would be 1MB.  I would like to split the 1 message interface into 4 x 250kb files without having to split the message interface?
    Thanks,
    Miguel

    Hi,
    If you split into 4 files each one should be a XML file right?
    This is possible without BPM.
    Go thro the blog:
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    Wat u need to do is make the target side 0..unbounded. If u have 100 records, Map some  25 records in first occurence, 25 in second and so on. This way u can reduce file size.
    Regards,
    P.Venkat

  • Receiver FTP Adapter - Directory create

    Hello,
    the XI FTP Receiver Adapter by default creates the target directory on the FTP Server if it does not exist. The J2SE Engine had an option if you want to create the directory or not.
    Is that available in the XI 3.0 J2EE FTP Adapter? I could not find it. Further if that can be set, would the adatper throw an error?
    Thanks
    Stefan

    Hi Stefan,
            I'm facing the same issue, while trying to create a dynamic folder in the FTP server.
    The FTP adapter failed with the error 'An error occurred while connecting to the FTP server 'ftpserverip:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 /root/dynamic/: The system cannot find the path specified. '. For details, contact your FTP server vendor.
    Were you able to resolve this issue using any SAP notes?
    Thanks in advance.
    Thanks,
    Joe.

  • Receiver FTP Adapter Problem

    Hello. My scenario is: A file is sent from R/3 via RFC, then from XI to an outside system using the FTP adapter. The RFC part is working, but I've encountered some errors with my FTP adapter. The file is not being created in my directory at all and this is the error message I'm getting:
    - 2006-10-11 08:28:20 CDT: Error: Message processing failed: Exception: ftp access error: com.sap.aii.adapter.file.ftp.FTPEx: 552 transfer failed
    Can anyone help, please?
    Thank you.
    Nicole

    Hi Nicole,
              A few things you might check are:
    1) The Ip address given is correct.
    2) The login details given in File receiver adpater are right
    3) The server is running when you make the transfer, that is 'Allow logins' status is checked in case of guild FTP server or similar servers.
    4) The destination directory is given as "/root" with "/" slash.
    5) All the firewalls are turned off.
    6) File processing mode is 'Create'.
    Cheers,
    Ashish

  • Specifying current directory in Receiver File Adapter

    Hi Experts,
    I have been configuring a receiver file adapter to place a file onto an FTP server. As per the information provided, as soon as I login to the FTP server, I have to place the file in current logged in directory. In this case, how can I mention this in file adapter as to use the current directory path to place the file? What should I enter in 'Target Directory' in File Access Parameters?
    Thanks,
    Dhawal

    Hi Praveen,
    Since file directory parameter is mandatory, my question is what should I enter in this parameter so that the file adapter will know that the file should be placed in the root directory itself?
    Regards,
    Dhawal

  • Archiving files sent by Receiver FTP Adapter ?

    Hello,
    we search for a solution to archive a file, which was sent by a receiver File/FTP Adapter (via FTP) to a ftp server.
    in an other directory on the FTP server. (Similar to the standard function of the sender File/FTP Adapter)
    Any Ideas ? A hint would be nice.
    Thanks.
    Regards
       Thorsten Stork

    Hello Thorsten Stork,
    This will help you
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Hi Vishnu,
       Happy to see you in SDN Forum,
    Regards
    Agasthuri Doss

  • SOA 10g: Dynamic Host Name and Port in FTP Adapter

    Hello All,
    I am using GET operation in FTP Adapter. I wanted to make Hostname,portName,Username and Password Dynamic.
    Pls suggest how to achieve this in SOA 10g.
    thanks,
    Ab

    or http://blogs.oracle.com/adapters/2010/04/changing_the_connection_factory_jndi_dynamically_in_ftp_adapter.html
    the make the jndi dynamic, but you still have to setup all the jndi lookups before you can dynamically can change them

  • No Source Directory on Sender FTP Adapter

    Hi Guys,
    I am using a sender adapter to poll an external FTP Server. The adapter is able to see the server fine.
    My problem lies in this:
    The company in charge of the FTP server has put a restriction disallowing the 'cd' command on the ftp server.  Now in the sender ftp adapter, the source directory is a mandatory field and therefore if nothing else, I need to put a '.' into the source directory.
    This in effect will do a cd . when it logins into the ftp server.  It is here that I get an error because command cd is disallowed.
    Does anyone know how I can prevent the sender ftp adapter from automatically doing a cd command i.e. have no source directory?
    Thanks,
    Miguel

    Hi,
    I think it is not possible with file adapter .
    Have a look into this SAP note -821267 Question no 27,34.
    It may give some inputs
    Regards,
    Moorthy

  • Transfer of all files in a directory tree using FTP adapter?

    Hi,
    I'm looking for a solution to transfer a whole directory tree, including the content, from one location to another using the FTP adapter.
    Is there an easy way to accomplish this?
    Any help would be appreciated.
    Thanks
    Sigrid

    Hi Sigrid,
    I'm just wondering on the need to do that using SOA. Is it a regular transfer or one time?
    There's a way to move a single file from one FTP location to another on the same or different FTP server (link to the cases). But in order to move all the files in a directory, you'll have to loop this. The high level steps will be:
    - List all the files recursively that are present in your directory using File List operation
    - Implement the MOVE file operation (or COPY operation) of the FTP Adapter
    - Invoke this MOVE operation in a while loop and pass the file names, as gathered from the File List operation, one by one to MOVE operation
    You can also use single Java Embedding activity and call a Java class that does the File Transfer but depends on your requirements.
    Let us know how you get along.
    Regards,
    Neeraj Sehgal

  • Error when setting dynamically the target URL in receiver SOAP Adapter

    Hi,
    I'm setting dynamically (from the mapping) the target URL in the receiver SOAP adapter:
    String url = "http://mosxd30:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=DUM&receiverParty=&receiverService=&interface=SI_OA_CustomInvoiceData&interfaceNamespace=urn:repsol.com:laboratory:firma";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "TServerLocation");
    conf.put(key, url);
    The receiver adapter fails with:
    "invalid content type for SOAP: TEXT/HTML; HTTP 401 Unauthorized"
    Reading weblogs, etc, the most probable cause for this is a wrong target URL, but then what I did was to set it as a fixed URL in the C.Channel, and it worked, so the URL is fine.
    In the communication channel, I'm using "Configure user authentication", with a user and password, and what I think it's happening is that if I use another different URL dynamically, the channel is ignoring the user authentication settings.
    Any ideas?
    Thanks

    I forgot to say that I've checked the SAP note "FAQ Soap adapter", and it says:
    Q: I get an authorization error "401 Unauthorized" from the adapter's servlet. What went wrong?
               A: The adapter's servlet is protected by default. You must use one of the user names assigned in security role xi_adapter_soap_message for component XISOAPAdapter. Please consult the documentation for Visual Administrator to view and change the security setting.
               The user authentication of the SOAP adapter is not part of the SOAP adapter but of the web container of the J2EE engine. The default authentication setting is defined in the web.xml descriptor file of the SOAP dapter web application. This setting may be modified from Visual Administrator with some restriction. Please refer to the security documentation for the J2EE engine.
               Please note that 710 onwards there is no Visual Administrator instead the Netweaver Administrator is to be used to assign the roles to the user to access the SOAP adater servlet.The user must be assigned one of the following roles SAP_XI_IS_SERV_USER, SAP_XI_APPL_SERV_USER, SAP_XI_DEVELOPER_J2EE, SAP_XI_ADMINISTRATOR_J2EE.
    The target URL is a sender soap adapter (the result of one interface is sent to another one via soap adapter), and it's this one which is complaining because of the authentication I think. But I don't know why it's ignoring the user authentication flag I'm using.

  • Generating HTML Files via RECEIVER File Adapter

    Hi All,
    I have the Following Scenario: 
    R/3 ( ABAP Proxy ) -
    >XI------>HTML Files ( File Adapter ).  
    Basically I would like to generate, HTML files out the RECEIVER File Adapter.   How can this be achieved?
    I  have invested some time in thinking about a adapter module, which can do this? Any Blogs would be Helpful here.
    Is there any alternative way? 
    Any Blogs or help Links would be appreciable.
    Thanks in advance,
    Best Regards,
    Abhishek Vinayaka

    Hi
    Look these thread for Create HTML file format
    if the reciever adapter is file i want in messages to be  in HTML format
    Re: idoc-xi-file scenario.  how to display file in html format

  • Receiver FTP adapter not intialized

    Hello all,
    I have set up a receiver File adapter but when I check the adapter monitor it shows me "Adapter not initialized"...The authorizations are prefect since I have set admin id's in the FTP server username and pwd. I would like to check the adapter engine to see if this adpater has been turned on..What is the URL to check the adapter engine in the J2EE stack ?? Also I set up a mail adapter which never shows up in the adapter monitor ..What could be missing??
    -Ken

    Hi,
    go to the path:
    <server>\<sapSID>\DVEBMGS10\j2ee\cluster\server0\log\services\com.sap.aii.adapter.file.svc
    inside you should be able to find all of you adapters
    config_[adaptername] files.
    inside you can see their configuration and sometimes
    an error message at the end
    maybe there will be something over there  
    Regards,
    michal

Maybe you are looking for

  • ORACLE 8.0.5 on SuSE 5.3 and 6.0 - Corrupt Block

    I do some heavy loading (Designer 2000) and I do get similar errors on 2 different computer with mirrored disks -different systems - on each one. So I'd like to exclude hardware problems. it's experimental - so I do not run archives - Designer on W95

  • ORA-00601 Error using JDBC, Oracle 8i on Linux

    Hello, Spatial is considering using Oracle as its database platform. I was assigned the task of benchmarking the two platforms. So, I downloaded the latest copy of Oracle for Linux, version 8.1.6.1.0 ( 8i Enterprise Edition Release 2 ). I'm using Red

  • Problems with the graphic card and adobe photoshop cs5

    hello, i installed adobe photoshop cs5 for my sisters computer: specifications: Prozessor: AMD Phenom™ II X6 1090T Six-Core Prozessor(3,2GHz, 9MB Cache) Festplatte: 2x 1 TB SATA II Arbeitsspeicher: 8 GB DDR3 Grafikkarten: VGA PCI-Express ATI Radeon™

  • External Monitoring with Decklink

    First of all: CS 6 really is an epic improvement! It feels almost like a fcp 8. Almost... (system: Mac OSx 10.7.3, prp CS 6.0.1, deckllnk studio pro, 9.5.2) There some bugs, I think, that make life not sunny all the way through. 1. External monitorin

  • Page - view only

    Hi, is it possible to open a complete page in a 'view only' mode? I have 2 user groups and I would like to restrict them from doing any changes - I know I can hide the save button etc - but are there other solutions possible, e.g. on page level? Than