Dynamic Filename in Fileadapter

Hi all,
I like to use the new feature (SP15) of the "Adapter Specific Message Properties" but with out success. I have read Michaels Blog "XI: The same filename from a sender to a receiver file adapter - SP14" but it give me not a clue how to use these properties during the normal receiver configuration and also the manual is not very clear about it. I have set a Variable with "FileName    message:FileName" (I have tried also "message:File_Name") Than I have used this filename Variable in the field "Filename Schema" like %FileName%. But I allways got this error: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'FileName' for variable 'FileName'.
What have I missed out here?
Thankx
Manfred Schmidt-Voigt

Hi Manfred,
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

Similar Messages

  • Dynamic filename in XI

    Hi,
    In XI SP12 is possible to use dynamic filename? I need to generate a filename in Adapter using the content of an element in message, how I do it?
    thanks.

    Hi Elton,
    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

  • Dynamic filename in receiver AS2 adapter in B2B Add-on

    Hello Experts,
    Can you please let me know how we can put dynamic filename in the receiver AS2 adapter for B2B Addon on SAP 7.4.
    Thanks
    Saurabh

    Hi Ryan / Experts,
    Let me explain you in more detail.
    In the receiver AS2 Communication channel, if I keep the Filename field as blank as shown below, then in the Mendelson inbox folder, a file is generated with the name "ASJAVA_DX5" which is my business component name.
    If I fill the filname field for example with "CONTRL", then in the Mendelson inbox folder, a file is generated with the name "CONTRL".
    This is my requirement because, suppose i trigger this interface "first time", a file with static name (ASJAVA_DX5/CONTRL ) would be generated in the inbox folder. If I trigger this interface "second time", since the file already exists with same name, it is not overwritten and I cannot check the output of 2nd trigger . Contents are not overwritten.
    To solve this problem + as a general requirement, I wish to have this name to be dynamic, atleast with date+timestamp.
    Can you please help.

  • Dynamic Filename in BPM process (SOAP with attachm. and PayloadSwapBean)

    Hello together
    I have the following BPM process:
    1. IDoc=>WebServiceRequest
    2. WebServiceResponse (payload) => IDoc
    3. WebServiceResponse (attachment) => File
    XI receivs an IDoc an map it to an WebService. The Webservice is called by XI and we receive the WebServiceResponse including a PDF attachment.
    The challenge is to store the PDF attachment with a dynamic filename from the payload of WebServiceResponse.
    We use the PayloadSwapBean to change the payload to the PDF attachment. But then we are not able to access the required information on the original WebService-XML-Response via variable substitution.
    Is there a solution in the standard or have we to use a custom adapter module?
    Thx
    manuku

    Hi Jayasimha,
    We can do this by "Adapter Specific Message Properties" of ur comunication channels.
    1.If u want to keep the output filename same as input filename, no need to use the UDF. only the 'adapter specific parameters' in both sender n receiver file adapter will do that.
    In case if u want to get the filename inside our mapping we have to create a user defined function
    which will return the filename and map it to one of our XML tags. 2nd point gives solution 4 that:
    2. If u want to generate an output file taking some input from the payload,then u hav to use the UDF.There u hav to populate the name.
    Pretty much.... if you set an attribute from the sender side, for example, you can use a UDF and access the particular attribute sent and use it in the mapping. In another example, where no attributes are sent from the sender, you can still actually set a particular attribute, say a filename derived from the payload, using a UDF, and enable the receiver attribute to use it. That's where the UDFs come in - either to get or set particular adapter specific message attributes.
    This will be a very helpful blog which solves ur query:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Vinod.

  • FTP how to pass dynamic filename/directory location - reading a file in 11g

    Hi All,
    We r using FTP adapter(SOA 11g) for getting files in remote server, May i know how to pass dynamic filename and directory where the file exists for reading in server.
    Thanks,
    Rak

    Hey according to my understanding, the Dynamic partner links are set only for the Outbound invocations only. Is my understanding right? if so, how do we create the dynamic partnerlinks for the ftp get kind of stuff...??
    Thanks in advance

  • Dynamic filename configuration via custom EJB

    Hi Experts,
                        We are doing a poc on whether we can do the dynamic filename configuration,i.e. set the file name dynamically in a custom EJB deployed on the server and called in the sender comm. channel of any J2EE based adapter.
    The requirement is for some interfaces, there is no mapping requirement other then setting the filename dynamically, which maybe based on a certain value of the input file or a specific portion of string in the payload.
    The custom EJB takes the namespace and attribute as input parameters along with other string manupulation parameters to determine the receiver file name. That is if we are using sender JMS adapter, we can have namespace = http://sap.com/xi/XI/System/JMS and attribute as DCJMSMessageProperty1. The bean would read the value and perform the manipulation based on certain other input parameters and set the file.
    There is one particular bean : AF_Modules/DynamicConfigurationBean but it does not allow us to manipulate the filename.
    Any help would be much appreciated.
    Regards,
    Shiladitya

    Hi,
    please refer to the following links for your reference
    Re: Reading Dynamic Configuration information in side adapter module.
    Re: Dynamic Filename in File adapter
    Regards,
    Bhanu

  • Dynamic Filename

    Hi
    i am using the variable substitution method in file adapter for dynamic filenam.e But the adapter is throwing error saying
    "Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1"
    am using the variable %var1%.dat in the filename.
    Any idea why happens. Am in SP14.
    And if use Adpter specific message properties, it is saying FileName missing. Even if i give this as variable it is not taking.
    Regards
    Andy

    Anandan
    Check the help..If its part of message Payload you need to prefix with  <b>payload:</b>
    %% isused incase of attributes of the message header
    Chk the help@
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>

  • ABAP mapping split messages and dynamic filename

    Hello,
    i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
    Regards,
    Andreas
    Edited by: Andreas on Feb 26, 2009 9:09 AM

    you cannot do dynamic configuration for message splits. The below is from SAP help.
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    u25CF     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    u25CF     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    u25CF     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

  • How to pass dynamic filename to Receiver JMS channel

    Hi experts,
    I want to pass the dynamic filename to receiver JMS message Properties.
    for example
    I am passing directory name via adapter module AF_Modules/DynamicConfigurationBean with key and value combination like below. How to pass dynamic filename value to a dynamic property ( say DCJMSMessageProperty1)
    eg.
    key.0 - >insert http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0
    value.0 - >  testdirectory ( which is static value)
    Note: Im have not created any ESR object . i just have to bypass the file to a jms queue. I have used AAE integrated configuration scenario ( file to jms )
    Regards,
    Balaji
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:45 PM
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:46 PM

    Already given link for the dynamic configuration code snippet in the earlier reply... Below is the code snippet
    Note: Use Adapter Specific Message Attributes for the target Communication Channel(CC).Check the indicator for filename in the advanced tab of CC
    //UDF code
    String filename="";
    String NameSpace = "http:/"+"/sap.com/xi/XI/System/JMS";
    try{
          DynamicConfiguration conf = (DynamicConfiguration) param.get(
            StreamTransformationConstants.DYNAMIC_CONFIGURATION);
          DynamicConfigurationKey key  =  DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File",   "FileName");
           // read filename value
           filename = conf.get(key);     
          // So far we extracted filename value .. now do your logic  something like this...
          DynamicConfigurationKey key2 = DynamicConfigurationKey.create(NameSpace,"yourjmsvalue goes here");
           conf.put(key2,filename);
         } catch(Exception e){

  • Dynamic FileName based on environment

    Hi expert,
    I have a proxy to file scenario in which I create dynamic FileName using an UDF. I'm using UDF because filename must contains date with a particular date format (yyDHHmm).
    My need is to generate file name prefix based on environment, for example:
    In DEV environment FileName must start with T
    In QTY FileName must start with Q
    In Prod FileName must start with G.
    Is possible to catch the environment name in UDF (I think from DynamicConfiguration)?
    Which values I have to test in the IF statement?
    thanks,
    Fabio

    Hi Fabio,
    Is possible using:
    String EnvironmentName = (String) System.getProperty("SAPSYSTEMNAME");
    Then, you can use the IF statement and a Concatenate statement:
    String output = null;
    if (EnvironmentName == 'DEV') {
    output = "D" + Filename;
    } else if (EnvironmentName == 'QAS') {
    output = "Q" + Filename;
    } else if (EnvironmentName == 'PRD') {
    output = "P" + Filename;

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

  • Does Seeburger's SFTP adapter support dynamic filename creation

    Hi all,
    Does the SFTP adapter support dynamic filename creation.
    If yes, then do we have to use UDF's and are there any specific settings that have to be done in the SFTP communication channel.
    Please provide a blog which helps in the configuration process of the above case.
    thanks,
    younus

    Dynamic Creation of File using counter in Seeburger Variable:
    1. Configuration Needed in the Communication Channel:
    The process of dynamic creation of files can be done we have to select the following checkbox in the receiver channel:
    Dynamic Attribute in receiver Channel:
    Import the following modules:
    Localejbs/Seeburger/solution/sftp
    Localejbs/Seeburger/AttribMapper
    Localejbs/ModuleProcessorExitBean
    Enter  the desired file naming convention:
    Use the Parameter GetCounter("ID") to the place where the counter is expected to come.
    2. Configuration Needed in the SeeBurger Workbench:
    If the J2EE server is listening on a port different from 50000 (which is the standard for the SAP client 000), the port number must be configured:
    Login into the seeburger workbench using the URL
    http://<localhost>:<port number>/seeburger/index.html
    Select Property Store.
    Create or edit the following property:
    Parameter
    Value
    Namespace
    http://seeburger.com/xi/SeeFunctions
    Key
    provider.servlet.server
    Value
    http://localhost:50000/ (where the port number 50000 must be set
    accordingly to the J2EE server configuration).
    Note: The configured value (server URL) has to end with a slash (/). Otherwise,
    SeeFunctions will not work correctly.
    If we need to start the counter from any specific value , it can be configured in the SeeBurger workbench, this value can be maintained in Mapping Variables :

  • FileAdapter write mode - Dynamic filename, write down simple text structure

    Hi,
    I tried to use the FileAdapter in a BPEL Process to write down and existing structure as String, comming from Database (CLOB), which has a defined structure.
    My first problem is, that I assign an output filename through the output message header variable, but it does not work. Instead always the name from the Filename convention is taken (wizard like po_%SEQ%.txt).
    My second problem is, that the FileAdapater destroyes the format during the write procedure. E.g.: The String structure is as follows:
    MKKOPF EF585773 07.05.2009 1 XXX Spielapparate u. Restaurant- betriebsgmbH 40031356 Brehmstraße 21 1110 Wien 900000585773 EUR ML
    MKMAIL [email protected]
    MKEINZ EF4428643 28.06.2009 Test Card Casino XXX Gesamtausgabe Textteil Allgemein Großanzeige 4C 1 ST 1 489,00 489,00 GES
    MKPOS. EF4428644 26.07.2009PRVB 948,66 / 10 / +5% WA
    a.s.o, . So you can see, its quite a simple format, which has to stay like that!
    First I tried to use the opaque mode for the fileoutput format, but I was stopped, because of the '/' characters in the source data. So I used the native builder to create a xml schema (I used deliminated file, multiple records, deliminated by white spaces, tabs and spaces). To identify the multiple records, I have chosen the end of line (eol). Except EOF and EOL there is no other choice, like CRLF,\r,\n!
    However, testing my native format, result in writting a file with containing a single line with the original data. So the original line breaks are gone, and therefore the system who should process it further gets an parsing error!
    The simple question is, how can I simple write down string data (containing German special chars, like Öäü --> ISO8859-1 and also XML reserved values like /) through the file adapter without destroying its structure?
    Second, how can I pass dynamically the filename, as using the output header values does not work?
    I hope some specialists are out there.
    Thanks & BR,
    Peter

    Hi James,
    here what I am doing.
    I read some records from the database throught the database adapter. The returned records representing strings, which should be written, line by line separated by 0xA (\n) to a single file.
    Also for the file write we use a Oracle SOA Adapter --> the FileAdapter.
    We discussed quiet some time about opaque schema and native builder. So on my understanding only the native builder version works. Otherwise I get an error, because of the contained slashes in the string record.
    What I am searching for is an easy way for aggregating this database row strings and append it with 0xA (\n).
    With XPath functions, like create-deliminated-string(node, '#xA') I had no success. Adhering to XML the signs #xA should represent 0xA, but it does not work.
    Also in using the encodeLineTerminators &#10; is not working.
    So I had really write a long bpel construct, combined with a Java Code Emeeding to do such a simple thing:
    Here is the interessting part (hiden the while loop, index handling and final fileadapter write call details):
    <while name="While_1"
    condition="($VariableSapBillingJobs > 0) and ($VariableIndex &lt;= $VariableSapBillingJobs)">
    <sequence name="Sequence_4">
    <sequence name="Sequence_4">
    <assign name="Assign">
    <copy>
    <from expression="concat(bpws:getVariableData('VariableBuffer'), bpws:getVariableData('InvokeSapDataSelection_eBillingSapDB4Select_OutputVariable','eBillingSapDB4SelectOutputCollection','/ns8:eBillingSapDB4SelectOutputCollection/ns8:eBillingSapDB4SelectOutput[$VariableIndex]/ns8:LINE'))"/>
    <to variable="VariableBuffer"/>
    </copy>
    </assign>
    *<bpelx:exec name="JavaAppendCRLF" language="java"*
    version="1.5">
    <![CDATA[String buffer = (String)getVariableData("VariableBuffer");    
    buffer += "\n";     
    setVariableData("VariableBuffer", buffer);]]>
    </bpelx:exec>
    <assign name="AggregateStructure">
    <copy>
    <from expression="$VariableIndex + 1"/>
    <to variable="VariableIndex"/>
    </copy>
    </assign>
    </sequence>
    </sequence>
    </while>
    There must be a simpler way like that!
    Do you or somebody else a simpler way? Doing it with the FileAdapter native builder, or at least with a XPath function?
    Furthermore my next homework is, the inverse operation. I will read a file, this time terminated with 0xD 0xA, and must translate it to XML to use it further in my bpel process.
    Also here I have not the idea, where the fileadapter supports me.
    Thanks & BR,
    Peter

  • Dynamic Filename in Receiver mail adapter is it possible without module?

    Hi,
    I need to send the file name in email adapter dynamically.Presently iam getting the filename as untitled.xml in the email .The keep attachments is checked in the mail adapter.
    I need to rename the file based on the input field name and timestamp .for example if i get the input field xxxx then the filename should be set as xxxx + timestamp .xml.I tried to use the UDF for dynamic configuration but it didnot help me out.Please help me.
    Thanks
    Rajesh

    Use below code snippet... It should work. If you want timestamp different change accordingly. Currently I do date followed by time as per my requirement.
    SimpleDateFormat simpledatFormat = new SimpleDateFormat("yyyyMMdd");
    Date date = new Date();
    String datewithYear = simpledatFormat.format(date);
    SimpleDateFormat simpledatFormat1 = new SimpleDateFormat("HHmmss");
    Date date1 = new Date();
    String datewithMs = simpledatFormat1.format(date1);
    DynamicConfiguration conf = ((DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION));
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    String oldFileName=conf.get(key);
    String valueNew;
    if( oldFileName == null){
                           valueNew =oldFileNamedatewithYeardatewithMs+".xml";
    //set the new filename
    conf.put(key, valueNew);

Maybe you are looking for