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

Similar Messages

  • 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.

  • 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

  • Using File Adapter with Logical Name

    I am creating a file adapter with Logical name. Apart from giving the Logical name is there any other configuration that I am suppose to do on the Web Logic before I start using it?
    Thanks in Advance.

    After configuring the file adapter, all you need to do is , give the path as a value for the logical name which you have created earlier. That you can do on the file adapter property inspector. There is no need to do anything on the server level. Lemme know
    Thanks,
    N

  • Error in Receiver File adapter using File content Conversion

    Hi,
    I am getting the following error in the receiver file adapter.
    Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'statement.fieldFixedLengths' or 'statement.fieldSeparator' is missing
    I am using the below parameters for FCC:
    Recordset Structure - statement
    statement.endSeparator - 'nl'
    statement.fieldSeparator - '0X09'
    statement.fieldNames -xblnr,wrbtr,newbs,kostl,newko,prctr,xref1,rke_wwfud,rke_wwst3,blart,bukrs,bldate,budat,gjahr,monat,ctype,waers,bktxt,posnr,wbs_element,mwxkz,businessplace,businessplace,c_waers,c_wrbtr,g_ctype,g_waers,g_wrbtr,h_ctype,h_waers,h_wrbtr,trade_id,lob,sgtxt,zuonr,reason_rev,ldgrp,tcode,lifnr
    ignoreRecordsetName - true
    Please let me know where i am going wrong.
    Thanks,
    Aparna

    Hi Aparna,
    I feel the problem in your content conversion parameters is with
    statement.fieldNames and ignoreRecordsetName
    When you are confirguring receiver file adapter for file content conversion the above one is not required. Please refer below link for details on configuring content conversion in file adapter
    [http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm]
    Hope this helps !!
    Regards,
    Amit

  • File Adapter or File  Transport which one will give more performance

    Hi all,
    File Adapter or File Transport which one will give more performance ? in OSB?
    Which one to select any one did performance analysis?
    Thanks
    Phani

    Why don't you just go read some benchmarks?
    http://www.barefeats.com/mbpp18.html

  • Sender File Adapter with file conversion

    Hi guys,
    I’m using a Sender File adapter with file conversion. The message to be processed has a structure with fixed lengths and in your content are some values that needs to be ignored.
    An example:
    value1  <b>value2</b>  value3…
    I want to ignore <b>value 2</b> but I can’t find a parameter for that! Do I need to define dummy fields on my data type and ignore those fields during mapping? Or there is a specific parameter for that?
    Thanks in advance,
    Ricardo.

    hi,
    there always is another way:)
    you can import the whole line to one field
    and cut it inside the adapter module
    (then you can define start and stop of the substring that you need to use)
    but of course it's not standard even though it's quite easy to achieve in java
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • 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

  • Mail Receiver adapter - dynamic file name without mail package

    I know that we can get the dynamic attachment name using mail package... As per the FAQ Mail adapter, the Mail package use is deprecated and hence we do not want to go that route.
    I have seen the following wiki entry for setting the file attachment name...
    http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
    Is this the only approach to dynamic attachment name using Mail adapter (and without Mail package). Or a different approach without Adapter module is possible?

    There is a different approach without using mail package or adapter module.
    Have a look at this Wiki:
    http://wiki.sdn.sap.com/wiki/display/ESOAInfrastructure/Dynamic+Email+Attachment+name+for+Received+Mails+with+ASMA+and+without+using+mail+package

  • 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

  • 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 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

  • IDOC to multiple file with dynamic file names with same content

    Hi,
    My scenario is from IDOC to file.
    The number of files which i need to create is dynamic, which depends on the number of plants.
    I have a Z-table where i will maintin list of all plants ( non SAP plant names).
    I need to fetch the data from this z-table and depending on the nunber of plants i need to create the file for each plant and fiel name should contain plant name in it. EX: abc_<plant>_datatype.txt
    I want to use only receiver one CC, and files should be created in the same directory.
    Can we do this without BPM?

    Hi,
    You can use the Mapping lookup concept to fetch the plant names from Z-tables and then you can use the variable substitution technique to resolve your purpose.
    Here you need to create multiple interfaces ie.e per plant to create multiple files. You can use common Communication channel for all.
    Mapping Lookup
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/frameset.htm
    Mapping Lookups - RFC API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/frameset.htm
    Variable Substitution
    An interesting usage of Variable Substitution in XI
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    SP12 -Variable Substitution option
    Receiver File Adapter:Variable substitution :FATAL  ERROR
    Thanks
    Swarup

  • 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

  • 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.

Maybe you are looking for

  • Consuming XI webservice in Dot net application.

    I have created a Xi webservice and hosted it on a server.Now I want to consume this webservice in a dot net application. But while consuming it I get a binding error from the webservice.Does anyone has a solution fron this. Do I have to do some XI se

  • How do I switch my windows 7 to macbook pro?

    How difficult is it to switch my entire windows 7 computer to my macbook pro?

  • Trouble connecting Ipod Touch 2G to Belkin Tunecast auto

    Hi there! I just bought my Ipod Touch 2G on this Chritsmas and find it really cool, but... I have this one problem, when I try to connect it to my new Belkin Tunecast auto, it just doesn't stop sending the audio trough the internal speakers in order

  • How can I eradicate this "Visual Touch" malware form my Mac OS X?

    How can I eradicate this "Visual Touch" malware form my Mac OS X on google chrome? I have tried everything i've seen in these forums so far, removing all extensions, manually added suggested filters & even uninstalled the entire browser and its conte

  • Appending a record in an internal table while debugging

    Hi gurus,           i am trying to add one record in a internal table at run time in debugging mode. i am adding the same record which is already exist in that internal table to test for some scenarios.after adding adn once if i click save, all the d