Dynamic File Name in Data Source?

In Data Model, there is a option "File" as Type. My question is can file name be dynamic, say I set a parameter "ReportID", can this parameter be part of file name. something like
{$ReportID}.xml
or
{:ReportID}.xml
If yes, what is the syntax.
Thanks.

I don't think you can do that. When you speficy 'File' as the type for the Data source, it expects an existing XML data file stored in the directory that has been set up by the Administrator.
There is no way to define a parameter for the file name and then use this instead..
Thanks!
Edited by: BIPuser on Mar 1, 2010 1:10 PM

Similar Messages

  • Dynamic File Name depending on the Source File name

    Hi Experts,
    I have a problem like Dynamic File name depending on the Source File Name. I will explain with example as follwos
    Source File name                 Targer Folder/Filename
    NK01.VR59.L2007030         VR59/Rec.l200
    NK01.VR71.L2017030         VR71/Rec.l201
    NK01.VR77.L2027030         VR77/Rec.l202
    See above the exaple, Depending on the Source file name, I am deciding where i need to place my file and what name i need to name it.
    So please suggest me the solution and How can i do this with a single communication channel ? Do i need to create multiple CC for each folder??
    Points will be rewarded for Valuable anwer.
    Thanks in Advance,
    Best Regads,
    Vijay

    Hi VIjay,
    Thanks for quick reply. But i am getting error in End to End Scenarios only. If i remove the Return " "  statement from the UDF, while activating it is showing the error saying like missing return statement. I also mapped to the top most node to this UDF.
    I am getting the following error in End to End error Scenarios:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • Problem in dynamic file name in File reciever adapater

    I have given my file name as
    %abc%.txt
    and in the advanced mode
    i have given
    Additional parameters as
    abc=
    payload:file_reciever_mt,1,FileNameNode,1,FileName,1
    while my file reciver structure is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:file_receiver_mt xmlns:ns="urn:filetofiledemo"><recordset><data><name></name><age></age></data></recordset><FileNameNode><FileName>Amit123</FileName></FileNameNode></ns:file_receiver_mt>
    My file is getting store as %abc%.txt
    not as Amit123.txt
    I am using SP 14 .
    Any pointers wld be very helpful
    Thanks
    Amit

    Hi Amit,
    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.
    Apart from my previous post, you can also use Adapter Specific Identifiers in your Sender and Receiver File Adapters to copy the same file name from the source to the target.
    take a look at this blog for the same,
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    -- Bhavesh
    cheers,
    Prashanth

  • Dynamic file name from input payload (RFC 2 flat file)

    Hi,
    I have an RFC to flat file scenario. The output flat file has not an XML structure, it's just a plain text file generated with abap mapping.
    In my source interface (RFC), I have a field called <FILENAME>, I want to use the value of that field to create the target file using dynamic file name. But if  in variable substitution I use payload:ZRFC_NAME,1,FILENAME,1 It doesn't work because the dynamic variable substitution try to access to output payload, not the source one...
    What can I do?

    Hi Marshal,
           You can add a extra node to your target strucutre like
    FileName- Node
    --FileName - Element.
    do the mapping from the field filename of RFC to FileName field in u r target strucure. And use this  field path at Refrence in variable subtituion.
    In the Content converison add the Name & Values as below
    FileName.fileldNames -- FileName
    FileName.fieldFixedLengths -- 0
    FileName.fixedLengthTooShortHandling -- Cut
    So the extra field in u r target structure would not populate in u r target text file.
    Cheers
    Veera

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Dynamic File Name - UDF

    Hi Master,
    I written the UDF for Getting the Dynamic File name.
    DynamicConfiguration conf = (DynamicConfiguration) container.getParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Retrieve the filename
    String FileName = conf.get(key);
    This is working ok - but I want to return these values so I can be used in mapping.
    when I try to add the statement return FileName; , the compiler then complains with the following error:
    cannot return a value from method whose result type is void return FileName;
    Please help me,
    Thanks,
    Anu

    Thanks Nithiyanandam,
    I am using the Same code. But i am getting the Syntax error:
    Source code has syntax error:  E:/usr/sap/DX1/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapaf708c00d6bb11dd83ee00101816a382/source/com/sap/xi/tf/_MM_I_FF_O_RFC_.java:13: cannot resolve symbol symbol : class variable location: class com.sap.xi.tf._MM_I_FF_O_RFC_ variable a; ^ 1 error
    UDF Name: FileName
    while creating the UDF, I select the first radio button(Value). not  Context and Queue.
    I written the below code.
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "FileName");
    String FileName = conf.put(key, a);
    return FileName;
    Thanks,
    ANU

  • Dynamic file names on file based  processing

    Hi Experts
    we are doing file to file scenario using file based processing not on message based ( No Reposiitory Objects - No mapping , no interface objects ).
    we need to pickup the file name from the source directory and place it in the target directory with the same file names.
    the source file name is added with the time stamp and client number,
    Since there no mapping , we can't use the dynamic file concepts.
    Please help me with the possible solutions
    thnz for the help in advance.
    Cheers
    Faheem

    Hi Faheem,
    You will be using the dynamic config when u want to map the input file name to a field in the target message.
    As per ur requirement ASMA will do :
    try this:
    In both the sender and receiver file adapters , select Adapter Specific Identifiers and File Name
    In the receiver file adapter give some dummy value for file name and directory.
    In the runtime, the source file name and directory will be used as the target file name and directory.
    You need not use any UDF or a mapping here
    Hope it helps!!!!!!!!

  • Dynamic file names in outbound file adapter

    I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
    Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
    Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
    I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem.

    I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
    Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
    Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
    I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem.

  • 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

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

    Hi Friends..
    in My Idoc to File..
    i want to generate Dynamic File Name ..
    i put the logic in Message mapping -java intialization section
    Container container = null;
    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 = "HRXML"+datewithYear+datewithMs+".xml";
    else{
    valueNew =oldFileName+datewithYear+datewithMs+".xml";
    //set the new filename
    conf.put(key, valueNew);
    and i did in reciever File adaper adaper specific settings..
    i am getting error sxmb_moni..
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_ZHRMD5_to_HRMasterData_MM_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>java.lang.NullPointerException</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_ZHRMD5_to_HRMasterData_MM_: java.lang.NullPointerException</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    if we remove the dynamic File configuration  logic in message mapping ..i am getting the result..
    please guide me..

    Container container = null;
    DynamicConfiguration conf = ((DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION));
    bound to get a NPE as your variable container is not getting intialized to a valid object ref here...

  • Dynamic File Name on Receiver Side using XSLT mapping

    Hi,
      My scenario is a Proxy to File scenario.The File on the receiving side is a TEXT file generated due to XSLT mapping. The file name has to be dynamic like- TEST<DDMMYYHHMMSS>File.DAT.
    If somebody knows how to do the same please help.
    Regards
    Ritu

    Hi Ritu,
    I agree to Krishna.With your XSLT mapping create a XML output which can be converted to a text file with content conversion.
    And for the dynamic file name, i guess its the date that matters which needs to be in DDMMYYHHMMSS format. the same can be accomplished by a Java function and calling it in your XSLT .
    Do refer this weblog it will help you accomplish the same.
    >>> /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    Regards,
    Shabarish

  • How to handle Dynamic File Name

    Hello All,
    I have a  requirement, I have to download a file from application server to my ABAP program which will be executed in the background. The problem is the file name is a dynamic file name with timestamp on it. So how do I read the file from the application server. I know there are certain function modules but I don't think so that they can work in background.
    So If anyone has worked on it before your reply would be helpful.
    Thanks and Regards,
    Sushil

    Hi,
    Use this funcation module this will return you the list of files in a directory...
    It will work even in back group processing also..
    SUBST_GET_FILE_LIST
    or if it is unix environ ment.
    data: begin of t_tabl occurs 0,
    line(132),
    end of t_tabl,
    data: lc_command(100) type c.
    Get all the file name falling under specified directory...
    lc_command(3) = 'ls '.
    lc_command+3(45) = p_dir. " Directory of file path
    call 'SYSTEM' id 'COMMAND' field lc_command
    id 'TAB' field t_tabl-sys.
    Check any files exits in the directory.......................
    if t_tabl[] is initial.
    message e006 with 'No files exist in the specified directory ' p_dir.
    endif.
    here you will have all the file names in t_tab1 you can sort by name and will get the latest file in order..
    Thanks
    Mahesh
    Message was edited by:
            I Can Solve It

  • 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

  • Generating file name with date

    Hello,
    I try to create via ABAP a file name with date in it. Normaly my script must run but the script won't run. Please help. Thanks.
    data = sy-datum.  " = data set to sys date
    data+6(2) = '01'. " = first day of month
    data = data - 1.  " = last day of last month
    file name creation
    p_filename+0(21) = '/sapio/flatfiles/xxx/'. " = first part of file name
    p_filename21(6) = data0(6). " = second part of file name
    p_filename+27(15) = '_XXXX_XXXXX.csv'. " = last part of file name
    p_subrc = 0.
    Regards, Thomas

    Hi again!
    Now I try it with your hints but now I got a save error.
    program conversion_routine.
    * Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rsldpsel.
    * Global code used by conversion rules
    *$*$ begin of global - insert your declaration only below this line  *-*
    * TABLES: ...
    * DATA:   ...
    data: data like sy-datum.
    *$*$ end of global - insert your declaration only before this line   *-*
    form compute_flat_file_filename
         using p_infopackage type rslogdpid
      changing p_filename    like rsldpsel-filename
               p_subrc       like sy-subrc.
    *       Insert source code to current selection field
    *$*$ begin of routine - insert your code only below this line        *-*
    * Datum wird gebaut
    data = sy-datum.  " = data set to actual date
    data+6(2) = '01'. " = first day of month
    data = data - 1.  " = last day of month before
    v_date = data+0(6).
    * Dateiname wird gebaut
    p_filename = '/sapio/flatfiles/XXX/'v_date'_XXXX_XXXX.csv'.
    p_subrc = 0.
    *$*$ end of routine - insert your code only before this line         *-*
    endform.

Maybe you are looking for

  • Can i hav 2 ipods on 1 computer?

    i hav an ipod (1st gen) and used it on our computer and evrythings kwl, bt my mum got an ipod 4 her bday can(2nd gen) can she hav hers on the same computer? she pluggd hers in nd uploaded itunes 7 and all of my music is now on her ipod is ther anyway

  • Sequence of condition types in MIRO for import P.O

    Hi! In case of import P.O. scenario, while capturing customs duties in MIRO, the sequence of condition types is not as defined in P.O. ( no GR bassed IV, MIRO before MIGO). For example, sequence defined in P.O :                                       

  • 3G nano cuts to menu during movie playback...

    Guys, Whilst watching a movie on my iPod nano, it frequently just cuts out and returns back to the menu without holding the position of where it was last at... very annoying... I'm up to date with all the latest software downloads, so I'm struggling

  • Burning CD's- Choosing CD Drive

    I need to choose a different CD drive (an internal one, called NoteBurner) to burn CD's to but when I go to Edit> Preferences> Advanced there is no "Burn" option. I have the latest iTunes update. Where is this option so I can choose my CD drive? Even

  • Installing Oracle EBS 11i installation problem

    Dear All, I have a problem regarding the installation of Oracle EBS 11i of which I can't figure out a solution. After unzipping all the 108 files during the rapidwiz installation the installer seems to halt (in step 1, 100% of file extraction). It in