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

Similar Messages

  • Dynamic  File Name for Receiver File Adapter

    Hi All,
    How can we use dynamic name for Receiver file adapter?
    Can anyone help.
    Thanks in Advance
    Chemmanz

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

  • 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

  • Unique file name for saving file on server.

    Hi
    I am having a servlet which will be used to save a file from client machine to server.
    Now, this servlet can be used with multiple users through web at same time.
    All user will be uploading files.
    There will be cases where 2 users from different location will upload files with same name.
    Thus, it is important for me that I append some string in uploaded file name, so that file name stands unique.
    How can I get this unique number.
    Is there no instance number for generated class !!.
    Thanks

    A few years ago I found this code on the Internet. I have forgotten where, but I'ven been using it since then and until now it always generate the unique number.
          * Generates unique ID based on timestamp, thread ID, random seed and random
          * double. Each part is converted to hexadecimal, padded left with zeros to
          * a length of 8 chars and then concatentated to each other.
          * @return Unique 32-char hexadecimal string.
         public static synchronized String getUniqueID() {
              final String pad = "0";
              final int padLength = 8;
              final int padDirection = StringX.PAD_LEFT;
              String timestamp = Integer.toHexString(Long.valueOf(System
                        .currentTimeMillis()).intValue());
              String threadHashCode = Integer.toHexString(Thread.currentThread()
                        .hashCode());
              String randomInt = Integer.toHexString(RANDOM.nextInt());
              String mathRandom = Integer.toHexString(new Double(Math.random()
                        * Integer.MAX_VALUE).intValue());
              // You may remove this try block if you want to increase performance by
              // 1ms.
              // But the generated ID might not be fully 100% guaranteed to be unique.
              // If you want to keep this block, then you can "almost" safely remove
              // the
              // randomInt and mathRandom parts of the UniqueID.
              try {
                   Thread.currentThread().join(1); // System.currentTimeMillis()++
              } catch (InterruptedException e) {
                   // Do nothing. However very, very, very rare. Haven't seen it
                   // earlier.
              return StringX.pad(timestamp, pad, padLength, padDirection)
                        + StringX.pad(threadHashCode, pad, padLength, padDirection)
                        + StringX.pad(randomInt, pad, padLength, padDirection)
                        + StringX.pad(mathRandom, pad, padLength, padDirection);
         }

  • Payload as File name at Receiver File Adapter

    Hi All,
    I have a requirement for a PROXY to File Scenario where Receiver files has to be named dynamically with a value from the Payload that I get. Also the particular field that has the file name should be unmapped with the Receiver.
    For Example,
       <row>
          <Name>Alex</Name>
          <DOB>27062014</DOB>
          <City>Delhi</City>
       </row>
    If this is the Payload I get, I want the Receiver file name to be "27062014.txt". At the same time this particular field should not be mapped at the Receiver end.
    I have tried a few links which confuse me further.Kindly help me,
    Thanks in advance,
    Sree Ram

    Hi Sree,
    Please check if the case is correct. refer the below discussion
    Problem in variable substitution
    reference blog for variable substitution
    Variable Substitution for Directory or File name.
    regards,
    Harish

  • How to keep same sender file name for receiver mail attachement

    Hi,
      i am working with File to Mail scanario. There i want to pick a flat file from native file system and then send it as email attachment. Now i am able to send the file but the flat is getting converted as an xml file. is there any method to keep the same sender file name and type for receiver mail attachment. i am not using any mail package. i am using XI payload and keep attachments.
    Thanks in advance.
    -Siva

    Hi,
    Yes,With out using the mail package u can send the Mail Attachments to the receiver side,
    In that case no need of Integration Repository objects.
    Chck this links.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    If u dont get ur requirement then let me know ur Mail id i will send u a Doc.
    Regards,
    Phani
    Reward points if Helpful

  • Dynamically generating file names for 2 File ( 1: 2 mapping transformation)

    Hi ,
    I have a scenario Proxy to File(FCC) with 1:2 transformation in message mapping ie 1 sender and 2 receiver interface ....
    1 Message mapping
    1 Operation mapping
    1 RD , 1 ID and 2 file receiver channels  and 2 receiver agreements.
    I need to dynamically generate the filename say abc.(first 9 characters of mesg id) and xyz.(first 9 characters of mesg id)
    I used dynamic configurations with ASMA settings, created 2 UDF assigned each of these to header node of r receiver message types.
    Here, I guess the second dynamic configuration is over writing the first dynamic configuration and hence creating only one file with xyz.(first 9 characters of mesg id)
    name .
    Need your valuable inputs
    Thanks and regards,
    Pavithra

    As dynamic configuration doesnot work in case of 1:n mapping what  you need to do is
    Create a field Filename in your source data structure
    Create a1:1 mapping between your source structure and source structure
    In that 1:1 mapping on the target structure assign UDF for file name
    Now this target structure will be used as a source structure in your next 1:2 mapping
    Under operation mapping add first the 1:1 mapping for source and then the multimapping
    regards
    Ninad

  • How I may change the encoding names for downloaded files?

    I have some problem with encoding when I download files from russian sites. The downloaded files look like this "ìîé êàáèíåò - èíôîðìàöèÿ"

    Firefox, as is, will only download the file. You can choose where the file is
    saved, but that's it.
    Go to the '''''[https://addons.mozilla.org/en-US/firefox/ Mozilla Add-ons Web Page]''''' {web link}
    (There’s a lot of good stuff here) and search for '''download managers.'''
    Many of them give you a chance to change the file name.

  • Variable substitution not working for dynamic file name in Receiver File CC

    Hi Experts,
    I am doing the scenario of Proxy sender to File receiver and my purpose is to Create the text file
    as per the filename available in Source Message payload.
    I am using the Variable Substitution method for this as shown below.
    Source Message Structure:-
         <Row>            -
    having Cocurence 1.1
             <Filename>     -
    having Cocurence 1.1
             <Item>            -
    having Cocurence 1.Unbounded
              <Field1>
              <field2>
             <Item>
             <Item>
              <Field1>
              <field2>
                <Item>        
         <Row>
    Target structure is same as the source structure and i have mapped the Filename field of the Source
    with the Target structure Filename.
    In ID the following is the File receiver CC Configuration.
    File Name Scheme:- %Dyn_filename%
    In Advance tab, I have selected the Enable option and added one row as Variable name %Dyn_filename%
    and Reference as payload:Row,1,Filename,1
    In testing I am getting the Error as 'variable Dyn_filename is not found in Message payload'.
    Please suggest me.
    Regards,
    Jagesh

    Hi Pooja,
    Hi Pooja,
    Thanks for your valuable reply..
    I  tried with the same. but still Filename is appearing in Output file.Giving you some details regarding my Receiver File Configuration settings.
    Target Message Type:-
              <MT_Target_Struct>
                    <Row>----
    1.1 occurence
                            <Filename_test>----
    1.1 occurence
                            <ITEM>----
    1.unbounded occurence
                                  <Field1>
                                  <Field2>
                            <ITEM>
                            <ITEM>
                                  <Field1>
                                  <Field2>
                            <ITEM>
                    <Row>
              <MT_Target_Struct>
    Recordset structure:-  Row,Filename_test,ITEM
    Row.fieldSeparator----
    >'nl'
    Filename_test.fieldFixedLengths----
    >0  (Zero)
    Filename_test.fixedLengthTooShortHandling----
    >Cut
    ITEM.fieldSeparator----
    >,
    ITEM.endSeparator----
    >'nl'
    I want only ITEM node to be written in the output file.
    Please suggest.
    Regards,
    Jagesh

  • How to get LR using unique names for each file?

    Hey there,
    I see LR does modify the name of the File when there is already one file with the same name in the folder of import, but once you choose a different folder it does import the File with the original name. I just realized that over the years using Folders such as Pictures 2009, Pictures 2010 and so on, I have three or four times Files with the same Name. Is there a way to tell LR to always use unique names when it imports?

    Use a date-description-sequence.ext naming template for renaming as you import [or if you prefer after you import]. This means you never have duplicates unless you for some bizarre reason use same name description for two sets of files on same day. And if you need to do just that, simply make the start number of second/third lot of files be one number greater than previous batch from same day.
    You can set up what ever naming format you desire in file rename dialogue and have that as your default.
    Leaving files names as they come out of the camera is asking for big trouble as invariably they will duplicate, which is not a good idea even if in different folders.
    F2 gets you renaming dialogue when in Library.

  • Dynamic File name in Receiver File adapter

    Hi,
    My Scenario is Proxy to File.
    I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
    How can i create a dynamic filename? i searched the forum, but i could not get the correct answer,
    Please help me out.
    Regards
    Srinivas

    Hi Srinivas,
    > My Scenario is Proxy to File.
    > I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
    public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
    DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String MyFileName = sono + div + "<filename>"+".xml";
    conf.put(key, MyFileName);
    return MyFileName;
    File name you can format according to your requirement.
    And one more thing for this you have to specify the ASMA properties. For this check the below link step-1 and step-2.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards
    Ramesh

  • Setting dynamic file name in Receiver file adapter - not from payload

    Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
    Please let me know if you remember this.
    Thanks a lot,
    Viktor Varga

    also u can check in
    <a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
    <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>

  • Dynamic directory name in Receiving File adapter

    Hi,
    In File to File senario, In receiving system i want to create directory name dynamically. In my mapping there is a field called name, the directory name in the receiving system will be value in the name field. Any one can help me how to do this one...
    Thanks
    Rao

    Hello,
    Please follow the below to achieve the same.
    input - Store number,
    UDF
    String dynaname = input;
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,dynaname);
    return "";
    UDF mapping
    Source[input]   -
    > UDF -->    Rootnode of target structure.           
    Hope it helps.
    best regards,
    raj.

  • File upload script not getting the file name for larger files

    Hi
    I have the following code (see extract below) and find that
    when the size of the file to upload is larger than about 300kb the
    code does not grab the file name. Consequently the upload fails.
    The code works fine when the file size is smaller.
    The code in the form page is:
    <form
    action="UploadAttachment.asp?SubjectName=<%=Request.QueryString("SubjectName")%>&VersionN umber=<%=Request.QueryString("VersionNumber")%>&QualificationName=<%=Request.QueryString(" QualificationName")%>"
    method="post" enctype="multipart/form-data" name="form1">
    <input name="file" type="file" size="100">
    <input name="Upload" type="submit" id="Upload"
    value="Upload">
    </form>
    The code in the UploadAttachment.asp page is:
    <%
    'Grab the file name
    Dim objUpload, strPath, SQLString
    Set objUpload = New clsUpload
    'there is a problem that this next line doesn't grab the file
    name if file is too large.
    strFileName = objUpload.Fields("file").FileName
    etc.
    %>
    If you have any idea how to resolve this I'd be grateful.
    Neil

    Hi
    I have the following code (see extract below) and find that
    when the size of the file to upload is larger than about 300kb the
    code does not grab the file name. Consequently the upload fails.
    The code works fine when the file size is smaller.
    The code in the form page is:
    <form
    action="UploadAttachment.asp?SubjectName=<%=Request.QueryString("SubjectName")%>&VersionN umber=<%=Request.QueryString("VersionNumber")%>&QualificationName=<%=Request.QueryString(" QualificationName")%>"
    method="post" enctype="multipart/form-data" name="form1">
    <input name="file" type="file" size="100">
    <input name="Upload" type="submit" id="Upload"
    value="Upload">
    </form>
    The code in the UploadAttachment.asp page is:
    <%
    'Grab the file name
    Dim objUpload, strPath, SQLString
    Set objUpload = New clsUpload
    'there is a problem that this next line doesn't grab the file
    name if file is too large.
    strFileName = objUpload.Fields("file").FileName
    etc.
    %>
    If you have any idea how to resolve this I'd be grateful.
    Neil

  • Counter in file name in receiver file adapter

    Hi,
    I am using FTP, my requirement is to add counter in the file name i.e XYZ001.
    And added to this i can increment the counter till XYZ020, after this i am supposed to start again from XYZ001.It will be some how handled that when i place XYZ001 for the second time , it will not overwrite the earlier one as it will be proccess by that time.
    I could have used addcounter but it doesnt work for FTP:(...also have seen /people/shabarish.vijayakumar/blog/2009/10/05/pixi-maintaining-sequence-numbers-in-file-name-scheme
    Do we have any new feature added in PI 7.1 for handling this.
    Regards,
    Abhi

    thanks shabz..
    Request you to please let me know how to proceed with the first option which you have mentioned i.e,how to create tables and will i be able to start the counter again from xyz001 once i reach xyz020? is there any abap code to be written (wiil be asking SAP counterpart ) or we need to do it in the dynamic configuration udf? Please let me know how to do the same.
    1. Maintain a table in SAP. Use/Code a RFC call to look up the sequence number from this table, incrementing the value after it is read. The result is then used in a dynamic configuration code, and the file name can be generated at that point.
    Will this impact performance ?..mine is a credit card authentication interface and response time is imp...
    Regards,
    Abhi

Maybe you are looking for

  • Password

    Hello I have just bought an IMac with Lion 7.2. I successfully set up Mail for my 2 BT email accounts. All was fine until I changed the password on my primary BT email account, and now Mail won't accept and keep it, ie, recognise it, and I'm continua

  • How do I get one EJB to refer to an EJB located on another server?

    Hi, I have two stateless session EJBs (A & B) contained in separate EAR files, and are located on separate servers within the same domain. How do I set up an ejb reference for bean A so that it can be used by B? If the 2 ejbs were located on the same

  • BUG: JDeveloper code editor shows valid static import call as error

    I've noticed what appears to be a bug in the JDeveloper code validator when dealing with static imports. The following classes demonstrate the problem: package test; public class Parent {   public static void parentMethod() {     System.out.println("

  • Insect under the keyboard of my Retina Macbook Pro?

    Hi! Yesterday I was working on my computer, when an insect (maybe a termite or a moth) fell from the roof onto the keyboard of my rMBP. I turned on the light and quickly searched for it but it was gone, so my guess is it could have gotten under the k

  • Final cut canvas video problem

    i haven't done a video in several months(i don't think this has anything to do with the problem) started on one,, recorded some video on the camera i always use, captured it and drug onto the timeline,, but when i started to edit from the timeline, t