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

Similar Messages

  • 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

  • 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

  • To Get Dynamic filenames while using sync get FTP Adapter?

    Instead of looping and getting filenames after file listing...
    i am thinking to use flow N.instead of while loop after filelisting..
    i am able to find, different file names in the assign activity, before the invoke activity which is assigned to Sync get adapter.
    but the sync get adapter is getting same file names in all the parallel flows.
    i can see it can successfully transfer one file, but fails with rest of those.
    is there any possibility, to pass file names dynamically to the sync get adapter..

    I want to conform you again, i want to use FLOW N instead of while..
    In whileloop the logic works fine, but when it comes to FLOW N , its failing
    as requested, code is fallows
    <assign name="Assign_InputDetails"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <copy>
    <from expression="bpws:getVariableData('Invoke_FileListing_OutputVariable','filelist','/ns2:filelist/ns2:file[position()=$i]/ns2:filename')"/>
    <to variable="Filename"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('Invoke_FileListing_OutputVariable','filelist','/ns2:filelist/ns2:file[position()=$i]/ns2:directory')"/>
    <to variable="InputDir"/>
    </copy>
    </assign>
    <invoke name="Invoke_GetInovice"
    inputVariable="Invoke_GetInovice_InputVariable"
    outputVariable="Invoke_GetInovice_OutputVariable"
    partnerLink="GetSourceFiles"
    portType="ns4:SynchRead_Inovice_ptt"
    operation="SynchRead_Inovice"
    bpelx:invokeAsDetail="no">
    <bpelx:inputProperty name="jca.ftp.FileName"
    variable="Filename"/>
    <bpelx:inputProperty name="jca.ftp.Directory"
    variable="InputDir"/>
    </invoke>
    where i in [position()=$i] is index variable declared in FLOW N

  • Cannot move any files into trash to delete them. I get a Trash warning box saying "The Finder cannot complete the operation because some data in 'file name' could not be read or written.(Error code - 36)".Macbook has so much data it is almost not working

    Cannot move any files into trash to delete them. I get a Trash warning box saying "The Finder cannot complete the operation because some data in 'file name' could not be read or written.(Error code - 36)".Macbook has so much data it is almost not working.
    I have tried reseting to factory settings by removing battery and holding down the power switch for more than 5 sec but this does nothing.
    Any ideas would be greatly appreciated as I think with so much unwanted data on the desktop and other places the whole os will crash very soon.
    Thanks, Rick

    The hard drive may be dying anyway, or the directory damaged because it is so full.  You should never let the hard drive get over 85% full.
    A -36 error is a read/write error.
    All you did with the power is reset the SMC.  Does nothing to reset everything to factory settings. 
    Do you have your original 10.4 installer discs for the MacBook?
    Is your data backed up?

  • The Finder can't complete the operation because some data in "FILE NAME" can't be read or writen. (Error code -36)

    I have a RAID that my Mac says is damaged. It does mount, so I want to copy as much of the data as I can. I tried SuperDuper!, but it crashed (or gave me error and stopped).  I tried copying and pasting entire drive (1.75TB) but it stopped with this error, and same error happens with some of the files when I try to copy and paste (Drag and Drop) them individually.
    I get this error: The Finder can't complete the operation because some data in "FILE NAME" can't be read or writen. (Error code -36)

    Well, in pure Apple File System talk... -36            ioErr            I/O error (bummers)
    Not very helpful, but generally means a Drive quit being Readable or Writable since starting the operation...
    http://fuzzy.wordpress.com/2006/12/10/ioerror-36/
    If Disk Utility or fsck should fail to repair it, your best bet is DiskWarrior from Alsoft, you'll need the CD to boot from if you don't have another boot drive...
    http://www.alsoft.com/DiskWarrior/
    Might try the free trial of my favorite, Tri-Backup, it does a better copy/clone job in that it usually doesn't quit copying at every error, & has a nice log afterwards to try certain files agin if you wish....
    http://www.tri-edre.com/english/products/tribackup.html

  • Synchronous Read operation in File Adapter

    Hi All,
    Can anyone explain me on 'Synchronous Read' operation in File Adapter.
    Thanks,
    Rakes

    There are 3 options for the file adapter.
    - Read used for polling files to invoke a BPEL process
    - Write used writing out a file, generaly used to finish a process
    - Sync Read is used to read a file in the middle of a BPEL process.
    What I mean by middle of a process is, a BPEL process can be invoked using a WSDL. The BPEL process can perform some operations and may need to read a file as part of that process as a file provides some information important to the process.
    A real life example would be having a java progaram that invokes a BPEL process via a WSDL. This application asks to process a file xyz in directory abc. You would get this variables from WSDL and read the file approprately.
    This is also an example of processing a file based on business rules in your BPEL process.
    cheers
    James

  • How synchronous read operation is outbound operation?

    Hello,
    1. what is the difference between read and synchronous read in file adapter?
    2. how synchronous read operation is outbound operation? Read must be an Inbound operation.
    Please clarify.
    Thanks in adv,
    kpr
    Edited by: 975937 on Dec 13, 2012 8:44 PM

    1. what is the difference between read and synchronous read in file adapter? Read is use for polling. Read option will initiate a new instance(and you will use a receive activity - inbound).
    2. how synchronous read operation is outbound operation? Read must be an Inbound operation. Synchronous read is being used from an existing instance (process). You will use an invoke activity for that - you are sending a request to read a file (file/directory name etc..). You are then getting back the result (file content etc....).
    Hope that answered your question.
    Arik

  • Error in reciever file adapter , where i am getting file name dynamically

    hi all,
    error in reciever file adapter , where i am getting file name dynamically, please help me in this isssue , i am trying for a long time
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)'

    i am getting new error
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
    this is my strcuture
    and i have changed my structure
    <HEADER>
    <ADDRESS1/>
    <ADDRESS2/>
    <ADDRESS3/>
    <ADDRESS4/>
    </HEADER>
    <HEADER_GST>
    <TAX1/>
    <TAX2/>
    <TAX3/>
    </HEADER_GST>
    <LINE>
    <QTY/>
    <UOM/>
    <UNIT_AMT/>
    <CHARGE_TO_DT/>
    </LINE>
    <FILENAME>
         <FILENAME/>
    </FILENAME>
    i have given the recordset structure as
    HEADER,HEADER_GST,LINE,FILE

  • 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

  • Need example to create File names dynamically using File adapter

    hello,
    I am mapping an IDOC to a flat file using XI and a file adapter. I need to be able to output a file name dynamically depending on the data in the IDOC.  For example if the IDOC has 310 as the company code, the file name should be xyz.310 and if the IDOC has 600 as the company code, the file name created by the file adapter should be xyz.600.  Please some body provide me with an example of the XSLT code that I will have to write in the dispatcher User Exit.
    Any help will be greatly appreciated.

    Nope
    But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
    So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
    SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
    UNION ALL
    SELECT Column1,Column2,Column3,1
    FROM YourTable
    ORDER BY Ord
    then choose  column headers in first row option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Move operations of FTP adapter

    Hi,
    I have used a FTP adapter with move operation to move file from one directory to another directory of different server. As per the Oracle document , I have specified the source directory , destination directory, source file name and destination file name in the BPEL source code. And it is working fine. But I have a requirement to be having the options to change these source directory , destination directory, source file name and destination file name from the EM console. But in this case it is not working. It is quite obvious , it will not be available from EM as it is driven by the BPEL code. So can anyone please suggest me whether we can use these move operation of FTP adapter driven by the adapter JNDI?

    Hi,
    You can add preferences to your composite, they can be changed on EM and your BPEL will retrieve the values.
    Have a look into this entry on Eric's blog...
    http://eelzinga.wordpress.com/2009/10/28/oracle-soa-suite-11g-setting-and-getting-preferences/
    Hope this helps...
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question
    https://forums.oracle.com/forums/ann.jspa?annID=330

  • Dynamically assign the file name for "on demand read"

    Hi.
    A quick question.
    I need to poll a directory using the on demand read function of the FB component, and change the file name in the BPEL process.
    Basically I need to dynamically overwrite the destination file name at runtime.
    These are the steps in my Process
    1. Pick up XML file,
    2. Assign a field in the xml file (fileName) to a variable (flatFileName)
    3. Poll a specific directory using onDemandRead and look for the fileName specified in the variable
    So obviously,
    I have tried to assign the variable flatFileName to the fileName property in the FB component of the readout variable. But it doesn't seem to work.
    Firstly I want to know if this is possible, and secondly, any idea on how to solve this issue.
    Thanks in advance

    I think it is not possible. becuase the date & time added at runtime. so if you check the table  PATH you can find filename and their definitions

  • 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

  • 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();

Maybe you are looking for