Dynamic file name creation using FTP adapter wired from a mediator

Hi All,
My Requirement is as follows....
Mediator is wired to Three FTP adapters to create three files.
File names are dynamic.
In the mediator those three routings, mappings and assignment for the directory and file name are being created.
But out of 3 files, 2 files are being created with the names mentioned during the FTP adapter configuration and the last one is being created
with the dynamic value.
Any help in this regard is highly thankful.
Thank you.
Srivatsasa.

Create a UDF in mapping taking counter from IDoc as input parameter
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String totalFilename = "AAAA_" + counter;
conf.put(key,totalFilename);
return  totalFilename; 
Map output of this UDF to Top node at target.
you will not be able to see the result in test tab of mapping but it works end to end
Select Adapter Specific Message Attributes in receiver file adapter..here select filename checkbox

Similar Messages

  • Processing files in Sequence using FTP Adapter

    Hi Experts,
    I have searched several forums but i am not clear on  how to process the files using FTP Adapter based on Timestamp.
    To process the files in sequence i.e, FIFO using FTP Adapter
    i have the files with file name customer and timestamp :  customer<yyyyMMddHHmmss>
    there are around 50 files in the FTP server llike this.
    I need to process these files acording to the timestamp and place the files in same processing sequence in the receiver end using the file adapter.
    If i specify the parametes in sender FTP Adapter as
    Qos= EOIO
    Queue name = ACCOUNT
    Whether these parameters would do the processing in sequence according to the Timestamp?
    Suppose if the queue ID for Inbound(SMQ2) is XBTI0_ACCOUNT then whether it will be the same for Outbound(SMQ1)?
    Kindly suggest me how to process the files in sequence according to the Timestamp using FTP Adapter
    Please reply..
    Thanks
    Sai

    Hi Shabarish,
    But this would require one more additional channel to process
    So i think it will take more time to process.
    Let me clarify my question once again.
    I need to Pick the files from FTP server based on their TimeStamp and in sequence.
    the file names are like this Customer<YYYYMMDDHHmmSS>.
    suppose i have 3 files as
    Customer20050413044534
    Customer20050414053430
    Customer20050315034533
    So i need to pick these files in this order and place the files in the same order to the receiver end(File Adapter)
    Customer20050315034533
    Customer20050413044534
    Customer20050414053430.
    As i am using FTP sender adapter i cannot use processing sequence "By Date".
    please suggest me on this.
    Thanks
    Sai.

  • Dynamic file name in receive FTP file adapter

    Hi, All,
    I have a ABAP proxy -> FTP scenorio. The sender side MT is like this:
    <Sender_MT>
      <FileName>abc.txt</FileName>
      <Record>
          <TEXT>.......</TEXT>
          <TEXT>.......</TEXT>
         <TEXT>  ......</TEXT>
    </Record>
    </Sender_MT>
    I would like to output the data which are the values of the tags <TEXT> to a flat file with the file name of the value of <FileName>
    I tried to use Variable Substitution in FTP CC. I set a val1 = payload:Sender_MT:1,FileName,1 .  But I got an error says "Unknown structure 'ns0:Sender_MT' found in document'. I looked at the message monitoring. It shows payload <n0:Sender_MT>. not <ns0:Sender_MT>. I think that is why I got the error. Then I tried to use XSLT mapping. I set
    <Receiver_MT>
    <Record>
         <xsl:value-of select="ns0:Sender_MT/Record"/>
    </Record>
    </Receiver_MT>
    But I get an error says "XMLParser: No data allowed here: (hex) 32, 64, 66(:main:, row:1, col:3): ".
    Could anybody help me out? Thanks!
    Jack
    Edited by: Jack  Mathew on Jun 4, 2009 6:22 PM

    Dude this looks purely like a variable reference error. Have you mapped the the Filename field in the target too? UR XSLT mapping dosent seem to indicate that... run ur mapping test to check that..
    Second ... if ur source structure is hierarchcially similar then var 1 should be -
    payload:Receiver_MT:1,FileName,1
    Regards,
    Arvind R

  • Assigning dynamic file name in the FTP adapater in OSB 11g

    Hi,
    I have got a requirement where I need to FTP a file(put operation) with a name which goes like this
    XYZ_<abc>_ddmmyyhhmiss. Here <abc> will be coming from a previous DB adpater query and is a column value so, will be dynamic.
    I have created a FTP adapter in Jdev and migrated all the files to Eclipse, created a Business service out of it.
    I can see the .jca properties in the JCA Transport tab of the business service.
    Now my question is how to set the value of FileNamingConvention field in the business service dynamically which i believe would let me set the file names.
    Regards,
    Satrajit

    use the action "set transport headers", setting the value of the jca.file.FileName and jca.file.Directory (if needed) to whatever you want.
    This action is available in a Route node only - I believe, not 100% sure

  • Dynamic file name creation problem

    Hi Friends,
                      I had a requirement where i had to generate file name at target side with the following format
    " raw_text_yyyymmddhhmmss.txt" . This can be acheived by using "currentdate" function but there is no field at target side which holds this value, if there was a field then i would have used variable substitution method to generate the file name.Another option is Dynamic Configuration UDF already
    my root node is mapped to some src field say FLD1 based on which i will be getting multiple files.
    How to customise this udf to get current date as filename for multiple target files:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    String Outputfile = conf.put(key,a);
    return Outputfile;
    Regards,
    Vinod.

    Hi Nityanand,
                          Your solution is right but actually problem here is recently a slight change was made for file name it should be "raw_text_yyyy-mm-dd-hh-mm-ss.txt"  by using variable substitution we get file name as this format "raw_text_yyyymmddhhmmss.txt"  .
    @Prateek: I cant give Currentdate as direct input to udf becoz we are generating files based on a certain field from source side.We are sorting this multiple source fields and generating target files.
    Any suggestions.....
    Regards,
    Vinod.

  • Rename file name & format using ftp sender

    Hi all,
    This is regarding the renaming of file at sender file(FTP) communication channel and placeing the same file in the same folder.
    At FTP server at sender side (i.e.clients place) is in .txt format.But now .txt file has to rename and change into .sav foramt with below required name convention of file.
    client format is  :  SAP_Order.txt (Pervious file name).
    We need to change the file in to "SAP_Order_yyyymmddThhmmss.sav" format..
    How can i achieve this requirement?
    Can please suggests me solutions ASAP.
    Best Regards,
    satya,

    Hi,
       if your requirement is to pick the  existing file in the FTP folder...and send as idoc to the target and place the renamed file to FTP folder...
    then its simple...
    use two receivers instead of one , one for point to target and other for sender itself... (second receiver  is for  changing  the file name format....)
    Hope the above understanding is correct...if not provide more details of your requirement...
    HTH
    Rajesh

  • Dynamic file name while using java mapping

    Hi All,
    i need help.
    I am using java mapping to convert xml file in zip file.
    Now i need to set output file name as SiteId_TimeStamp.zip.
    Site id is comping in xml file.
    How can i do this?
    I tried many thing but didnt get the solution..
    As their is no message mapping so I am unable to use ASMA.
    Please help.

    Did you check the wiki? You just need to add the code into you java mapping..
      Map mapParameters = (Map) transformationInput.getInputHeader().getAll();
       // a) Set Output File name
       mapParameters.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic",
                                                             StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
       DynamicConfiguration conf = (DynamicConfiguration) mapParameters.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
       DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
       //Depending on your requirement edit this logic. Here, NewDynamicName + CurrentDate will be output file name.
       DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
       conf.put(key, ("NewDynamicName_" + dateFormat.format(new Date())) + ".pdf");

  • Dynamic file name creation

    Hi All,
    I have this scenario: IDoc --> XI --> File (FTP)
    I need to create a file with a variable name: AAAA_nnnn.xml ;  where AAAA_ is the constant part,
    while nnnn is the variable part(it is a counter). The counter value could be included in the IDoc.
    I cannot use the variable substitution because I cannot modify the XML of the target message.
    Is there a method to pass the full filename to the file Adapter?
    Thanks in advance
    REgards
    Emiliano

    Create a UDF in mapping taking counter from IDoc as input parameter
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String totalFilename = "AAAA_" + counter;
    conf.put(key,totalFilename);
    return  totalFilename; 
    Map output of this UDF to Top node at target.
    you will not be able to see the result in test tab of mapping but it works end to end
    Select Adapter Specific Message Attributes in receiver file adapter..here select filename checkbox

  • Reports region csv file download: can a dynamic file name be used?

    Application Express 3.1.1.00.09
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
    Firefox 3.0.10
    Hi All,
    In Application Builder -> Report Attributes -> Report Export -> Enable CSV output = 'Yes'
    I want to assign the filename dynamically, based on a variable within the application.
    The text in this box always seems to be used as a literal value.
    Is what I want to do possible?
    Kind Regards,
    Bob.

    Yes, In the report name field you can use a page or application item as as the filename.. This is the syntax: &my_item. where my item is a page or application item..
    Thank you,
    Tony Miller
    Webster, TX

  • How to give a dynamic File Name for Receiver File/FTP Adapter.

    Hi Experts,
        I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out"  & in File Consturction mode i have given as "Add Time Stamp".
        therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
    where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
        How to do this ?
        for your info we are using ABAP Mapping.
        Pl help me
    Regards,
    Umesh

    Hi Umesh,
          Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
    And refer the below weblogs for Variable Subtiutuion File Name Scheme
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
    Hope this way would be solve u r problem.
    Cheers
    Veera
    >>>Reward points, if it is needful

  • How to change the JCA JNDI dynamically using FTP Adapter

    We have 5 FTP Servers, each having a directory to poll. We have created 5 CCI instances for these FTP Adapters in the FTPAdapter deployment. We created a BPEL process and using FTP Adapter to connect to above mentioned servers.
    Question: Customer's requirement is to use a single BPEL process to poll all these FTP Servers at a specified date and time. How can we connect dynamically to each FTP server at specified time.
    (OR)
    Is there any way to change the JCAJNDI dynamically in a FTP Adapter configuration ?
    I have seen that FTP Adapter POLL doesnt take any JCA JNDI/hostname/un/pwd/date/time dynamically.
    Regards
    Pavan

    Hi Pavan,
    It's possible to change the JNDI dynamically but only when you use put operation where you can control the JNDI name at the time of invoking the FTP Adapter as described in below link.
    Dynamic JNDI in FTP Adapter | jca.jndi property not picked by Adapter
    However, can you consider using BPEL process with SyncRead (and read files through all the JNDIs in a loop) and scheduling this BPEL process to a desired frequency?
    Regards,
    Neeraj Sehgal

  • Dynamic File name in File Adapter

    Hi,
    I have a requirement to pass dynamic file name in File Adapter.
    Is there any way to pass a variable for the file name attribut in file adapter.
    I am looking for some options apart from %yyMMddHHmmss%,%SEQ%...etc
    Please suggest if any of you have information on how to put values from a variable to file name attribute in file adapter
    regards
    Saiju

    Hi Saiju,
    Yes there is.
    Assign your file name to a variable, let's say 'fileName'.
    Now go to your invoke activity(for the specific fileadapter) -> Property tab-> find a property call jca.file.FileName -> in the value field assign 'fileName' variable.
    That's it... (assuming you are using 11g)
    Arik
    Edited by: Arik on Jun 27, 2012 3:12 PM

  • Xml file in dynamic file name in file receiver adapter

    Hi,
    I'm doing the dynamic file name in file receiver adapter. I have done as per instructed in /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    All turned out okay. I have got the file name I require. Except that the file format is XML and I need to suppress the filename node occupied by the dynamic file name.
    The content conversion mentioned in /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12, does not seem to solve my problem. As it is only for file format other than the XML one, because we only do the content conversion if we want to "convert" the format of the content from XML to the other format.
    Does anybody have the solution to my problem? thanks in advance

    Thank you Raj for the direction
    The way to do it is :
    1. In ID, advanced tab, put a check on the adapter-specific message attributes - file name.
    2. Put a "*" on the file name scheme
    3. In IR, create a UDF to set up target file name :
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // set up file name for receiver adapter
    String SourceFileName = conf.get(key);
    conf.put(key, TargetFileName);
    return " ";
    4. Map the above UDF to the header level of the target structure.
    Regards,
    Idi

  • 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

  • Dynamic file name while sending to target FTP

    Hi Experts,
    we have a scenario wherein we are trying to implement dynamic file names.
    The scenario is IDOC to file, and  we need to append the data corresponding to all the IDOC triggered n a daily basis.
    Its like  the file abc_01will contain data for day 1(data of oll the IDOC in that day).For day to we need to dynamically name the file as abc_02 and so on.
    But before naming the file as abc_02 we need to check if abc01 is present or not .If abc_01 is not present then for day 2 file  we need to give the name as abc_01 and so on_.This condition is need to be checked becasue there may be the case that a file may not be picked by the script running  at the target system.
    can anyone let me know how to check whether file are correctly picked at target.
    Regards,
    srinivas.

    Hi  Srinivas,
    I think you can achieve this with the next scenario:
    - For getting all the Idocs info, you need a ccBPM to collect them, and then, download them to a file.
    - To dynamically put the filename, you need to use Dynamic Configuration at the File Receiver Adapter (in the Message Mapping, you can write a UDF.)
    - And to check if the daily file exists, you can also write an UDF and then decide the name of the output file.
    Hope this helps,
    Regards,
    Juan

Maybe you are looking for

  • HEADER FOOTER HOWTO

    Hi guys, i need simply to have header / footer as they are on my office model. Howto? I was thinking that only with xmlp desktop version i was unable to see footer /header. Instead i get this: the header and the footer are displayed only on the first

  • X-axis chart

    I am having trouble clearing a chart that read in a waveform from a analog daqmxbase read vi. I wired an empty array to the history node of the chart. It clears the the waveform on the chart, but it does not reset x-axis values to zero. It keeps star

  • Web-enabled forms and Java

    We are developing a custom application using Developer 6. The application is web enabled using Oracle Application Server 4.0.7 and Developer Server on a Solaris 2.6. This application is an extranet for company use only. The problem that requires the

  • Separating a date read in from a file...

    I have a file which contains dates of birth in the form of 3 integers on each line, if I want to read in this line from the file and separate each (day,month,year), what is the easiest/best way to do this? The 'day' part of the date can either be sto

  • HT204409 i'm receiving a message for unable to join the network when entering in the wifi password

    the message I'm receiving on the Ipad mini when entering the home network password is: Unable to join the network!!!