FTP adapter pass file name to command

I am executing a command after the reciever FTP adapter.  The filename that ftp-ed has a dynamic name and I need to execute the command against that file.  Is there a way I can pass that filename as a variable to the unix command.  I know how the UNIX shell wants it, I just do not know how to set that name as a variable in XI.
Thanks
Skip Ford

Skip
Go through this url where you can pass the same filename from a sender to a receiver file adapter. But you SP should be 14 and above.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Hope this helps.....
---Satish

Similar Messages

  • Question about pass file name and path to file write adapter

    I need to pass file name and path to file adapter for write. I got partial answers from thread Re: Get File name using File Adapter , but seems InboundHeader_msg or outboundHeader_msg only takes file name, how do I pass file directory?
    since I still have to specify file format (like xxx_%xx%.txt) in the file adapter wizard. Will this name conflict with what the name defined in InboundHeader_msg ?
    Similarly, how can I pass a file name and path to a file synchread adapter?
    Thanks,
    Message was edited by:
    user531689

    Just overwrite the filename in the WSDL file that was generated

  • Passing file name dynamically in Synchronous read operation of FTP adapter in OSB

    Hi,
    We are implementing the integration in OSB 11g and using FTP JCA adapters to check if the file exists in the FTP location or not. We are using Synchronous read operation of FTP adapters. We need to pass the file name dynamically at run time. In the JCA file we can hard code the file name. How that file name can be taken dynamically using OSB.
    Regards,
    Sharmistha

    Hi Sandeep,
    This is possible.
    For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    In the case of receiver file adapaters, you have 5 options for file creation like,
    1.Create
    2.Append
    3. Add time stamp
    4.Add Counter
    5. Add Message ID
    You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Hope this helps

  • File adapter - How to pass File name and path at runtime

    Hi gurus,
    We want to use PI 7.0 as an ftp server and expose the config as a webservice where the service consumer can pass one or more file names and the path to pick them and drop them on a fixed ftp server.
    So precisely, I need to be able to set the file name, target directory parameters in both sender and receiver file/ftp adapters at runtime. is this possible at all ?
    I am aware of passing Adapter specific parameters from sender file adapter to receiver file adapter to create the same folder structure and file names. But my requirement is different. I hope I am clear.
    Could I please get some advise on this .
    Thanks & Kind Regards,
    Jhansi.

    Hi Jhansi,
    Either you can go ahead with dynamic configuration as said by other SDN'ers. Else can go with Java Mapping:
    Here is the code for 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 bytehttp://inputstream.available();
    inputstream.read(b);
    outputstream.write(b);
    } catch (Exception exception) {
    exception.printStackTrace();

  • Passing file name dynamically to the file adapter

    Hi All,
    I'm using a file adapter to create a file from the XML message after mapping in XI. The file name is given in the file adapter configuration. Is it possible to have the file name as a part of the message and pass it to the file adapter dynamically? Or is it possible to have the file name in some variable or something in XI (like a BPM variable) and pass it to the adapter for every message?
    Does someone have any idea?
    Thanks,
    Sandeep

    Hi Sandeep,
    This is possible.
    For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    In the case of receiver file adapaters, you have 5 options for file creation like,
    1.Create
    2.Append
    3. Add time stamp
    4.Add Counter
    5. Add Message ID
    You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Hope this helps

  • Need help with a simple process with FTP Adapter and File Adapter

    I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
    I can provide additional info such as the contents of my bpel and wsdl files if needed.
    Would appreciate if someone can help me with this at the earliest.
    Thanks
    Jay

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • FTP Adapter Trigger File Configuration

    Iam using the follwing link for the Trigger File Configuration , but this does not work,
    Can please anybody help me.
    Below is my JCA Configurations in WSDl looks like for my InBound FTP .
    <jca:operation
    FileType="ascii"
    PhysicalDirectory="/DALV1I/incoming/"
    ActivationSpec="oracle.tip.adapter.ftp.inbound.FTPActivationSpec"
    DeleteFile="true"
    IncludeFiles="oc4j\.xml"
    PollingFrequency="1"
    MinimumAge="0"
    OpaqueSchema="true"
    TriggerFilePhysicalDirectory="/DALV1I/incoming/"
    TriggerFile="Purchaseorder.trg" >
    </jca:operation>

    hi
    i am facing the same prioblem whcih kburchil is posted. Error's are posted below. Looking for the solution
    <2008-12-22 17:21:54,593> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Host files.oraclecorp.com FTP command: PASS
    <2008-12-22 17:21:54,984> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> FTP Command: NLST, reply:
    150 ASCII data connection for /bin/ls (/140.87.254.136,15,515) (0 bytes).
    <2008-12-22 17:21:54,984> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Control socket being read by [JCA-work-instance:FTP Adapter-14]
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Sending event: 1 with: oracle.tip.adapter.ftp.FTPConnection@13952a4
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> FTPManagedConnection::destroy called, closing physical socket
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Clearing Event Listeners
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Poller enqueuing file for processing :/MySharedFolders/abc/4673202.pdf
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Ignoring File : 4673202.pdf as it is already enqued for processing.
    Thanks in advance.
    Thanks,
    Synthia

  • Passing file name dynamically to sql loader ctl file

    Hi,
    I am new to scripting and I have a complex requirement involving writing a script.
    Requierment:
    I need to upload a CSV file from a FTP server into oracle table using SQL Loader. The file name resembles like APF0912312359.csv represents 31-DEC-2009 23:59 and there will be multiple files in same day indicated by differnt timestamp as its filename. Once I load a file using SQL loader, I need to move the file to another directory for archival.
    Since the sql loader ctl file has a fixed file name, I would like to know how I can pass the file name dynamically to ctl file to load a new file every time it runs.
    Any help is greatly appreciated..
    Bye
    Sudheer
    Edited by: user2138419 on Oct 28, 2009 4:08 PM

    I agree with Pradeep in regards to declaring the file names on the command line. However, I do have a concern regarding presenting the password on the command line as any user that can issue a ps (assuming Unix ~= Linux here) would be able to read it while the sqlldr command is running.
    Unfortunately, you may not always have the option of declaring the files on the command line. I was recently challenged with this in a Windows 2003 Server environment running SQL*Loader: Release 10.2.0.1.0. In this environment I found that I am able to set a variable file name in a calling batch file and use that value in the control file successfully. Just to demonstrate the approach:
    Batch file:
    set IN_FILE=’c:\inbound\load_me.txt’
    sqlldr user/pswd@db PARFILE=’c:\parameters.txt’
    Parameter file:
    errors=500000
    rows=50000
    control=%CTL_FILE%
    bad=%BAD_FILE%
    discard=%DSC_FILE%
    log=%LOG_FILE%
    Control file:
    LOAD DATA
    INFILE ‘%IN_FILE%’
    INSERT
    INTO TABLE table_to_be_loaded
    I’m really interested to see if this would work on Unix.
    -Luke

  • Issue with FTP Adapter ListFiles files with spaces in the filename

    Hi
    I have an FTP adapter that does a ListFiles of all the files in a directory. It comes back and everything works fine however it removes all spaces from the filename meaning when I do the GET afterwards this fails as it is a different filename.
    The filename is a0eQ0000000wJVdIAM~1~ technote316.TIF note the space between ~ and technote.
    When a ListFiles is done I get the following request response in BPEL execution:
    <messages>
    <InvokeGetFilenames_FileListing_InputVariable><part name="Empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><empty xmlns="http://xmlns.oracle.com/pcbpel/adapter/ftp/CommonServices/SalesforceNotifcationServices/GetFileNameFromFTPServer"/></part></InvokeGetFilenames_FileListing_InputVariable>
    <InvokeGetFilenames_FileListing_OutputVariable><part name="filelist" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><filelist size="1" xmlns="http://xmlns.oracle.com/pcbpel/adapter/ftp/CommonServices/SalesforceNotifcationServices/GetFileNameFromFTPServer"><file><directory>/salesforce/006Q0000007yKcd</directory><filename>a0eQ0000000wJVdIAM~1~technote316.TIF</filename><lastModifiedTime>1305507120000</lastModifiedTime><creationTime>0</creationTime><size>1906643</size></file></filelist></part></InvokeGetFilenames_FileListing_OutputVariable></messages>
    This then follows with a GET that fails:
    <messages><input>
    <InvokeGETfile_SynchRead_InputVariable><part name="Empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><empty xmlns="http://xmlns.oracle.com/pcbpel/adapter/opaque/"/></part></InvokeGETfile_SynchRead_InputVariable></input><fault>
    <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'SynchRead' failed due to: No Data to process.
    No Data to process.
    File /salesforce/006Q0000007yKcd/a0eQ0000000wJVdIAM~1~technote316.TIF to be processed was not found or not available or has no content
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    </summary></part><part name="detail"><detail>550 /salesforce/006Q0000007yKcd/a0eQ0000000wJVdIAM~1~technote316.TIF: No such file or directory</detail></part><part name="code"><code>550</code></part></remoteFault></bpelFault></fault><faultType>
    <message>0</message></faultType></messages>
    I'm guessing its some use of the jca.message.encoding I can't find anything that really explains this though. Just the http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/adptr_propertys.htm link.
    Any help would be greatly appreciated.
    Thanks

    Hi PG,
    Is your private file in the form of Java Keystore (.jks)? I had used .ppk file and it was a success.
    If it is .jks in your case, try using the same password for private key as of keystore file (.jks). I hope you're not supplying any PASSWORD in the Adapter properties.
    Regards,
    Neeraj Sehgal

  • File Sender adapter - source file name - weird

    Hi all,
    We have a sender file adapter polling an ftp location. The Dynamic config has been enabled to get the source file name.
    The actual file name is - "hrmd.xml", but in the dynamic configuration node, in sxmb_moni, the fileName is shown as ./hrmd.xml.
    This does not occur with any other file sender adapter comm channels polling ftp locations.
    I guess this has something to do with the ftp server. Did anyone face this issue?

    the fileName is shown as ./hrmd.xml
    The file name surely cant have a / in it....such characters are not allowed.
    is there any way we can change the fileName message attribute once the file is picked up
    Create a UDF for Dynamic Configuration and change the name as per your requirement (in XI)....the source file may be having proper format for name and i assume that you have to change it for receiver file name

  • In FTP server same file name with multiple vesions

    Hi All,
    My source system is UNIX. in that FTP server they have multiple files with same name  example " abc.dat"; with different versions example"abc.dat;43" "abc.dat;44", "abc.dat;45". . so how to read latest version file like "abc.dat;45"   from sender communication channel with file adapter.
    suggestions please..Thanks in advance.
    Edited by: venkataraonandigam on Jul 15, 2011 3:12 PM

    Hi VenkatRao,
    Sender file adapter configuration has an option "Processing Sequence". In the that select by"Date" or Name .
    If you used placeholders when specifying the file name, define the processing sequence of the files:
    ○       By Name: Files are processed alphabetically by file name.
    ○       By Date: Files are processed according to their time stamp in the file system, starting with the oldest file.
    Otherwise you have to write shellscrit to move the latest version file to a different folder and pick it up from that folder.
    Or
    write adapter module.

  • File Adapter - Create File Name from Payload

    Hello,
    I have a scenario where I'm sending deductions to external vendors (wage types) following a payroll run, via XI. Part of the message payload includes a data element 'Vendor Name' (e.g. Zurich Insurance). When the XI File Adapter creates the file, I want to create the files as /usr/file/xi/<Vendor Name>.csv
    How to I pick up the 'Vendor Name' from the message payload and pass this into the "File Name:" field of the "File Access Parameters in the File Adapter communication channel configured?

    hi,
    The dynamic filename generation concept is as follows.
    In your filename 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 pass file name as parameter into url: or fo:external-graphic src

    Hello gurus,
    In my rtf I want to dynamically get the name of the image file and display the image in the report. If use hard coded image file name it works but if I try to get the name into a variable and pass that variable it is not working.
    Basically my client is having different logos for each operating unit. in the OA_MEDIA directory there are separate logos for each OU. during run time based on OU name we need to display the corresponding image. If I can get this entire path($OA_MEDIA/logo.jpg') in XML field<?CF_OU_LOGO?> then I'm able to print the logo using url:{CF_OU_LOGO}
    But I'm using seeded data source and I cant modify the data source, I need to handle this in RTF only. I could able to get the file name into a variable but not sure how to pass to url.
    could some one help me on this. I tried the following options
    <fo:external-graphic src="url($ln)" />
    url:{$ln} in web etc...
    here 'ln' is the variable which holds '$OA_MEDIA/logo.jpg'. ln is defined as <xsl:variable name="ln" select=".//CF_OPERATING_UNIT" />
    later I set the values as <?xdoxslt:set_variable($_XDOCTX, 'ln',translate( concat('${OA_MEDIA}/','Logo',.//CF_OPERATING_UNIT,'.jpg'),' ',''))?><?xdoxslt:get_variable($_XDOCTX, 'ln')?>
    thanks,
    Vijay

    Vijay
    What version of EBS is the customer running? I read somewhere that in R12 all of the concurrent parameters are passed to the XMLP template. I have not tried this but if true. You could create a conc program parameter that would hold the location of the image. You could either have the user pick the image or maybe derive it from the other parameter choices.
    Lets assume the token name is DLOGO you can reference that in your template.
    <?param:DLOGO?>
    this needs to be at the top of the template. Then where you need to embed the image just reference the value using
    $DLOGO
    You can embed this in the external graphic field
    As I mentioned I have not tested it yet, hopefully its there, if not there are ways around it. Try it first.
    Tim

  • To pass file name and path as a parameter

    hi all,
    I am using forms6i. I am writing some records into the .txt file. Now i am writing as
    output := text_io.fopen('C:\users\filename.txt','w');
    but i have pass this file name and path also to the parameter(user has to mention the file name and path(if they want).
    please give some suggestion on this parameter.
    Thanks..

    Hi,
    So to select the directory, in the WHNE-BUTTON-PRESSED trigger write,
         :<block_name>.<path_item_name> := GET_FILE_NAME(' ', NULL, NULL, 'Choose any directory.', OPEN_FILE, FALSE);
         IF SUBSTR(:<block_name>.<path_item_name>, LENGTH(:<block_name>.<path_item_name>)) != '/' AND SUBSTR(:<block_name>.<path_item_name>, LENGTH(:<block_name>.<path_item_name>)) != '\' THEN
              :<block_name>.<path_item_name> := :<block_name>.<path_item_name> || '\';
         END IF;and to open the file, write,
    DECLARE
      FT_File  TEXT_IO.FILE_TYPE;
    BEGIN
      IF SUBSTR(:<block_name>.<path_item_name>, LENGTH(:<block_name>.<path_item_name>)) = '/' OR SUBSTR(:<block_name>.<path_item_name>, LENGTH(:<block_name>.<path_item_name>)) = '\' OR :<block_name>.<path_item_name> IS NULL THEN
           MESSAGE('Please Enter file name before continue');
           MESSAGE('Please Enter file name before continue');
           RAISE FORM_TRIGGER_FAILURE;
      END IF;
      FT_File := TEXT_IO.FOPEN(:<block_name>.<path_item_name>, 'w');
    END;Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • Reciever File Adapter - Temp File Name Scheme using Variable Substitution

    How can I create a temporary file that uses variable substitution? 
    We are having a problem with files merging when we write files using the "Use Temporary File" setting on the FIle Adapter.  So two independent files are merging into a single file.  We are not using the "Append" setting.
    We would like to use a Temp File Name Scheme that would append the message id onto the temporary file name. 
    Using variable substitution we created a msgid variable.  When added to the temporary file name using %msgid% the temporary file name is created with %msgid% in the name instead of the actual message id.  We put the variable into the "File Name Scheme" as well and the end completed file used the message id in the name.
    Any Ideas?
    Thanks,
    Matt

    HI Matthew,
    Why are you adding the message id into the temporary file??
    I understand that you want the output of the filename to contain message id .. and hence you are using variable substitution for the same.
    Temporary file name will anyways get overwritten by the actual file name (here the actual filename will be using variable substituion).
    So i suggest to achieve your scenario you can add any name in the temporary file and maintain the desired filename you require as output in the variable subsititution.
    Temporary File Name option actually acts as a lock - unlock mechanism from PI side while the file is getting written to the file server so that while PI is writting the file no third party application batch program picks it up.
    I hope this helps.
    Cheers
    Dhwani

Maybe you are looking for

  • Can't get EE and SE to play nicely with deploytool

    Hi, I have tried the following combinations of installations: j2se 1.4.x / j2ee 1.4.x (beta) j2se 1.4.x / j2ee 1.3.1 j2se 1.3.1 / j2ee 1.4.x (beta) With all of these combinations, the deploytool utility which comes with the j2ee bundle crashes on me

  • Script output of P.O

    Hi, In Purchase Order output form using script, I want to display HEADER Text just below the MAIN table Header. This Header text is entered in the Purchase Order. The script is copy of MEDRUCK. Please help me to solve this issue. Thanks & Regards Raj

  • Video Embedding?

    Hey there, I just had a quick question about how exactly the video embedding works. I'm currently making an eBook, and am seriously considering purchasing the Pro version of acrobat 9 (or pre-ordering x). With that said, would I need to include the v

  • When I go to my coupons app no coupons show up

    Hi  my coupons app tells me to customize my we content at the eprint website, I am Online everything checks out OK. Why does the app not work?

  • Computer clock will not auto update

    My clock will not update time. Keeps losing time daily. I can go in and it updates but not automatically. Is there a setting I am missing? Thanks for help. grntech