Dynamic File name in FTP Communication Channel

Hi All,
We have requirement where ,we create a filenames dynamically ( runtime).These filenames whihc do change for every execution needs to be added in FTP communication channel.
1. How can we add the this generated file name in FTP CC Communication Channel.
2. Does this file needs to part of target structure during graphical mapping ?
3. Can we also dynamically append the Directory name to file names aswell ?
Please provide your valuable sugestions.
Thanks for your support.

1. How can we add the this generated file name in FTP CC Communication Channel.
3. Can we also dynamically append the Directory name to file names aswell ?
to get the FileName:
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
To get the Directory:
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
Then append:
key+key1
And then in the CC select the Directory checkbox under the ASMA properties...
2. Does this file needs to part of target structure during graphical mapping ?
The file which is sent using the CC will have the FileName as configured in the UDF of the graphical mapping....and if i am not wrong then the target structure resembles the file (if there is no FCC done)....
Regards,
Abhishek.

Similar Messages

  • Get/put dynamic file name using FTP

    Hi Friends,
      I am currently using FTP_Connect, FTP_command and FTP_disconnect to get/put a file from a remote server.
    But the file name was changed to add a date/time stamp.
    So the filename became dynamic (example from 'test.txt' to 'test_200512160800.txt').
    I tried using get test. but my FTP command failed. Do you know anyway of doing this?
    Thanks.

    Hi Lego,
    here's another sample for the fm:
    REPORT ztest_epsf.
    PARAMETERS: date LIKE sy-datum,
                dir  TYPE epsf-epsdirnam,
                pattern TYPE epsf-epsfilnam,
                zid   LIKE vers_dest-rfcdest.
    DATA dir_list LIKE epsfili OCCURS 0 WITH HEADER LINE.
    DATA cnt_file TYPE epsf-epsfilsiz.
    DATA err_file TYPE epsf-epsfilsiz.
    START-OF-SELECTION.
      IF date IS INITIAL.
        date = sy-datum.
      ENDIF.
    *build pattern with input-pattern and date
      CONCATENATE pattern date '*' INTO pattern.
    *search for files in foreign system
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
           DESTINATION                   zid
           EXPORTING
                dir_name               = dir
                file_mask              = pattern
           IMPORTING
                file_counter           = cnt_file
                error_counter          = err_file
           TABLES
                dir_list               = dir_list
           EXCEPTIONS
                invalid_eps_subdir     = 1
                sapgparam_failed       = 2
                build_directory_failed = 3
                no_authorization       = 4
                read_directory_failed  = 5
                too_many_read_errors   = 6
                empty_directory_list   = 7
                OTHERS                 = 8.
      WRITE: / pattern.
      ULINE.
      LOOP AT dir_list.
        WRITE: / dir_list-name.
      ENDLOOP.
      ULINE.
      WRITE: / cnt_file.
      WRITE: / err_file.
    pls reward points for useful hints.
    thanks and
    regards Andreas

  • Issue with file name in receiver Communication channel

    Hi Experts,
      I am sending the files from SAP Application server to third party Application server.
    In my source folder i have different types of files with different names.
    but i need to pickup the files which is coming as of type sss_3300_was.txt and sss_3400_was.txt.
    what would be the logic for this.what my understanding is if i put sss_* it will works.
    If suppose the file is Exist in the folder as sss_3300_was.txt , so it will picked up and places in target folder.
    and next time if the file type is sss_3400_was.txt then that will pick up and places in the target folder.
    my question is, in the receiver comm channel what would be the file name scheme. i have tried with * and / but system has not been accepted as * can not be given.
    Kindly suggest what should i put in Receiver CommChanne file name sheme.
    Appreciate your inputs
    Thanks,
    Bhaskar

    Hi Satish,
    Thanks for your valuable inputs.
    Actually i need to change the subjet when i am asking other question...
    first thing is suppose i have 10 files like sss_3100_was, sss_3300_was, sss_3400_was........sss_3900_was  in the sender application folder and should be moved to receiver [target] folder with the same name.
    as you said mentioned above below is my undertsanding, please correct me if i am wrong.
    In sender cc
    1.  i will give file name as sss_*
    2. i will flag ASMA and also check file name.
    In receiver cc
    1. I will give file name as sss_*
    2. i will flag ASMA and also check the file name
    The above is my understanding with respect to your inputs,  is it correct?
    in receiver cc i have tried file name scheme as sss_*  but when i see the receiver CC log its telling that * is not allowed.
    may be i have not flaged ASMA at that time, but now i will flag ASMA in receiver CC dose it works? just need to confirm from you.
    Regarding seconf issue.
    when file is picking up from the source folder from SAP Application server as i can see file is picking up well and posting in third party folder and even in the sender cc and receiver cc logs i could see all shown in success.But when i see in the SXMB_MONI in the inbound interface the data are coming in the special charater format like @$??? and so on.But when i checked in SAP Appl server the same file contains the three lines of data like material number purchase order number and so on and it is Text file.
    below mentioned are done configs for sender CC by me.
    MP: file
    TP: NFS [as  it is SAP appl server]
    filepath:/
    file name: sss_*
    file type :text
                   add time stamp
                   ..... and so on
    Kindly advise me if any changes are required and also provide me inputs in case any correction.
    Thanks,
    Bhaskar Reddy

  • Dynamic file name using FTP adapter

    I was trying the dynamic filename scenario taking help from Michal's blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    If I check the 'adapter specific properties' in both sender and receiver file adapter,then in output I am getting the output filename as same as input filename without using the UDF.
    When I used the UDF in mapping,it had absolutely no effect. I am not clear what is the use of the UDF. please let me know where to use the UDF and how to use it.
    Thanks
    Smith

    1. In the mapping program that you are using populate the filename coming from the source into the target in any of the fileds.
    2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time.You can get dynamic filename in UDF in msg mapping....just in ID in comm channel select adapter specific attributes -> filename.....then whatever dynamic name you will create in UDF will be the target filename.....
    3. To change the adapter-specific attributes of the message header by using message mappings, you access the <b>required classes of the mapping API by using a mapping runtime constant.</b>
    To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
    You donot need to hard code the value of the filename in the file adapter for your interface.
    In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.

  • Dynamic file name in communication channel

    hello
    is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
    to get it out of a table or something?
    Thanks
    Kfir

    Hi,
    Yes its bit possible to use the dynamic file name at File access paramters
    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,
    Refer below links for more in depth details about it
    Re: Dynamic file name in Receiver File Adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check out this URL
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check these weblogs as well...
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    Thanks
    Swarup

  • 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

  • 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

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

  • Dynamic file name inside the ZIP file

    Hi Experts,
    I have done proxy to file scenario, reciever side is the file ZIP file, i have done successfully done Zip file using adapter modules in Communication Channel.
    The file name is hard coded like this.
    contentType-----Transform.ContentType--
    text/plain;charset="UTF-8";name="Billing.txt"
    Is there any possible to do dynamic file name instead of hardcoded like add time stamp.
    Kind Regards,
    Praveen.

    hi,
    you can always do it using an adapter module like shown in my blog:
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    Regards,
    Michal Krawczyk

  • 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

  • Sender FTP communication channel

    Hi experts,
    We have had the following problem twice with two different comm channels:
    A sender FTP communication channel stops polling for no apparent reason. There were no errors and the status remained green. After I stopped and started the communication channel in the runtime workbench the adapter picked up all the remaining files and processing finished ok.
    Anyone had this problem before? Any ideas for a solution?
    Thx,
    Philip

    Hi
    look Similar thread
    File (FTP) Adapter: stops polling
    File Adapter stops working

  • 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

  • Dynamic file name ?

    Hi,
    I am following this blog to name the target file/directory dynamically at the runtime :
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    But I am getting this error in the CC monitoring :
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'interface_name ' for variable 'var1'.

    Hi,
    Try following this weblog for dynamic file name.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Dynamic filename come under the Dynamic configuration in moni, for your messages.
    This is the code used inside.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return ourSourceFileName;
    That is why Dynamic configuration is coming in output.. It is a class to generate dynamic configuration file at runtime provided by SAP XI.
    Hope this will help you.
    regards
    Aashish Sinha
    PS : reward points if helpful

  • Dynamic file name in case of .txt output files

    Hi all,
    I have a query related to dynamic file name scenario.
    In case of IDOC-XI-FILE sceanrio,
    <b>Is it possible to generate .txt file name based on Plant number like</b>
    <b>%<Plantname>%_%<BusinessDay>_filename.txt</b>
    <b>Note:I have implemneted this for .xml output files but I am not able to implement it for .txt output files .</b>
    PLEASE HELP ME .
    Regards
    Prabhat

    Hi Prabhat,
    I think, the normal Dynamic File Name generation should work fine in your case also. Even if you perform Content Conversion, you can use Variable Name Substiution to create your Destination file name as, the name of the file is determined first and only then is the content converison perfromed.
    for info on content conversion, I would suggest that you go through this thread and check my reply,
    Re: Dynamic  File Name for Receiver File Adapter
    Regards,
    Bhavesh

  • 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

Maybe you are looking for

  • Just got an error when updating Itunes.. can anyone advise on a solution?

    The updater has been popping up for a while but i'v been fobbing it off. Finally updated today.After updating I went onto Itunes and an error came up, it said: 'Itunes cannot run because some of its required files are missing. Please reinstall Itunes

  • Opening External Files using SWF

    Hi all, Is there a way to open external files using swf? I have gone through a number of forums and all seem to tell me to open with a window projector. my problem is, I need to embed the swf into a html to be viewed online... So I need to do it in s

  • How to deactivate postings to custom table YFAGLFLEXA

    Hi, We have generated custom YFAGLFLEXT table using FAGLFLEXT as a template. This caused table YFAGLFLEXA to be generated automatically by the system to store the Actual Line Items Postings. Since the YFAGLFLEXA table is not of any utlity to us, we w

  • Replace missing fonts in eps files with scripts...how

    I have 1900 eps files with multiple missing fonts. I need to replace this fonts with some avaiable in system. Where I can find some script for this scenario? Script which can trigger "find font/change all" or similar. Actions dont work. thanks

  • Tethering problems with Macbook Pro

    Hi, I have trouble tethering my Canon D5 Marc II on my Macbook Pro > OSX Lion, on my MacPro  10.6.8 it works perfectly. The USb works well on other divecs, iphone ... Can anyone let me know how to resolve this issue? Thanks O