Dynamic FileName generation

Hi,
I have a source idoc xml file and the target structure has only 2 fields. Mapping contains only 2 fields which is used from the idoc and put to the fields in the target strucuture.
After transformation, I need to create a file with the filename in the format <idoctype>_<idocnumber>.xml. And also the idocnumber will be of certain length like 15 digits. if the idoc number is 2343 then the file name should be <idoctype>_000000000002343.xml.
If the value was to be picked in target payload then variable substitution would be the answer. But in this case it is from the source payload,
Please guide me.
Regards
Shashi

Hi
refer this blogs..
/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
Might help you
Thanks,
vasanth.

Similar Messages

  • 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

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

  • UIX: how to get dynamic image generation working on ias10G?

    Hi,
    Anybody got UIX Dynamic Image Generation working on ias10G, on unix? My Images do not get generated (the page only shows the plain links)
    My env:
    - ias10G
    - AIX Version 5
    - java version: unknown, do not know what version ias10G is using
    On earlier versions (OC4J 903) we had to make sure an XServer was running and pointed our DISPLAY variable to that server. When the XServer was down, we got a nice error message in the application logs. However on ias10G I cannot figure out where to set this variable and I cannot find any error messages.
    Can anybody please help me out a bit?
    Cheers,
    Martijn

    Hi Andy,
    Thanks for your reply. However, I have not yet been able to get it working.
    I have verified that the java version is indeed (this is what the oc4j logfile shows when I supply the -showversion parameter)
    java version "1.4.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1)
    Classic VM (build 1.4.1, J2RE 1.4.1 IBM AIX build ca1411-20030930 (JIT enabled: jitc))The relevant fragment of the opmn.xml:
              <process-type id="oc4j_cif_mh" module-id="OC4J">
                   <module-data>
                      <category id="start-parameters">
                         <data id="java-options" value="-Djava.security.policy=/oracbd/j2ee/oc4j_cif_mh/config/java2.policy -
    Djava.awt.headless=true -Xmx75m -Xms75m -showversion"/>
                         <data id="oc4j-options" value="-properties"/>
                      </category>
                      <category id="stop-parameters">
                         <data id="java-options" value="-Djava.security.policy=/oracbd/j2ee/oc4j_cif_mh/config/java2.policy -
    Djava.awt.headless=true"/>
                      </category>
                   </module-data>
                   <start timeout="900" retry="2"/>
                   <stop timeout="120"/>
                   <restart timeout="720" retry="2"/>
                   <port id="ajp" range="3301-3400"/>
                   <port id="rmi" range="3201-3300"/>
                   <port id="jms" range="3701-3800"/>
                   <process-set id="default_island" numprocs="1"/>
                </process-type>Finally, your JSP passes the test. I can access it. But still no uix image generation. Are there any logfiles I can check for error messages on the failing image generation? May it be a web cache problem?
    Thanks in advance

  • XMLParseException during dynamic theme generation

    Hi,
    I4m having problems with SQL statements in some requests to MapViewer during dynamic theme generation.
    When I put in the WHERE clause the operator "less than" the request fails. An XMLParseException is generated.
    For example:
    <jdbc_query XXXXXXX>
    select geom from table where column < 10
    </jdbc_query>
    the following exception is generated:
    oracle.xml.parser.v2.XMLParseException: Expected name instead of .
    When I change de symbol < to &lt; (like MapViewer Users Guide recommends):
    <jdbc_query XXXXXXX>
    select geom from table where column &lt; 10
    </jdbc_query>
    the following exception is generated:
    oracle.xml.parser.v2.XMLParseException: Unexpected EOF
    If the is no WHERE clause (select geom from table) the request works.
    What can be wrong ? Can I use the less than operator in the WHERE clause ?
    Thanks in advance,
    Rodrigo     

    OK. The OC4J version is 1.0.2.2.1. I4m using Oracle8i Enterprise Edition Release 8.1.7.0.0.
    Some examples of XML requests:
    1) This works fine
    <?xml version="1.0" standalone="yes"?>
    <map_request
    title=""
    basemap="MAP1"
    datasource="DS1"
    width="1098"
    height="648"
    bgcolor="#FFFFFF"
    antialiase="false"
    format="GIF_URL">
    <center size="73063.00272634998">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates> 376875.541941716, 7810266.276712325</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name ="PLANTIOS_MPD">
                   <jdbc_query
                   asis="true"
    spatial_column="GEOM"
                   render_style="C.PLANTIOS_MPD"
                   jdbc_host="MyServer"
                   jdbc_port="1521"
                   jdbc_sid="db01"
                   jdbc_user="scott"
                   jdbc_password="tiger"
                   jdbc_mode="thin">
                   select geom from table where column = 50
    </jdbc_query>
         </theme>
    </themes>
    </map_request>
    2) This doesn4t work ('<' replaces '=' in SQL WHERE clause)
    <?xml version="1.0" standalone="yes"?>
    <map_request
    title=""
    basemap="MAP1"
    datasource="DS1"
    width="1098"
    height="648"
    bgcolor="#FFFFFF"
    antialiase="false"
    format="GIF_URL">
    <center size="73063.00272634998">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates> 376875.541941716, 7810266.276712325</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name ="PLANTIOS_MPD">
                   <jdbc_query
                   asis="true"
    spatial_column="GEOM"
                   render_style="C.PLANTIOS_MPD"
                   jdbc_host="MyServer"
                   jdbc_port="1521"
                   jdbc_sid="db01"
                   jdbc_user="scott"
                   jdbc_password="tiger"
                   jdbc_mode="thin">
                   select geom from table where column < 50
    </jdbc_query>
         </theme>
    </themes>
    </map_request>
    3) This also doesn4t work ('&lt;' replaces '=' in SQL WHERE clause)
    <?xml version="1.0" standalone="yes"?>
    <map_request
    title=""
    basemap="MAP1"
    datasource="DS1"
    width="1098"
    height="648"
    bgcolor="#FFFFFF"
    antialiase="false"
    format="GIF_URL">
    <center size="73063.00272634998">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates> 376875.541941716, 7810266.276712325</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name ="PLANTIOS_MPD">
                   <jdbc_query
                   asis="true"
    spatial_column="GEOM"
                   render_style="C.PLANTIOS_MPD"
                   jdbc_host="MyServer"
                   jdbc_port="1521"
                   jdbc_sid="db01"
                   jdbc_user="scott"
                   jdbc_password="tiger"
                   jdbc_mode="thin">
                   select geom from table where column &lt; 50
    </jdbc_query>
         </theme>
    </themes>
    </map_request>
    Thanks,
    Rodrigo

Maybe you are looking for

  • Will not display Japanese text only boxes?

    how can I get it to display any Japanese text from websites with out it only showing boxes any input would be appreciated! The Japanese text I would love to see is Hiragana Katakana Kanji

  • Cannot resolve symbol: class NamespaceContext

    I get the following error when I compile import javax.xml.namespace.NamespaceContext; I have added jar files come with jwsdp-1.3

  • DYNAMIC SELECTION SCREEN uisng FREE_SELECTIONS_INIT

    Hi, I am facing a problem regarding the dynamic selection screen using FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG .After entering the values in Dynamic Selections on pressing Enter, the values are  getting distorted.For example if i gave the pur

  • SQLPLUS on Windows Crashes

    I have a oracle 8i server which has been installed and is running correctly on Sun Solaris 2.7 I tried to install oracle 8i client on NT/Win98 and I was able to install without any problems. But the problem is whenever I do select on a non existing t

  • Is it not recommended to use FOR ALL ENTRIES in version 4.5B

    Hi, Is it not recommended to used For all entries in version 4.5B as  Size limit for SQL is 32KB hence we should not be using FOR ALL ENTRIES, instead of this we should be using select inside the loop? Can anyone please let me know if this is correct