Changing time stamp format in the file receiver adapter file name

Hi all,
How can we change the standard date time stamp from
filename_yyyymmdd-hhmmss-mil
to
filename_yymmdd_hhmmss
i.e.,  I want "underscores" instead of "hyphens" and also I do not want the MilliSeconds.
I read in the forums that I have to use the combination of variable substitution and mapping functions to do this, but not sure how exactly.
Can the experts help me with this please?
Many thanks.

Hello Ramesh,
     You can make this possible using runtime filename creation using UDF.
Please go though the below steps.
Message mapping:  
Create an UDF and include the piece of code that captures the Filename and Timestamp from source side via ASMA.
Modify them according to our requirement by adding the <Timestamp> at the end of <filename> with _.
Map the UDF to any of the top level node so that the modified filename will be available for the target communication channel
UDF Code is:
try {
String filename    = "";
String timestamp = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
filename = conf1.get(key1);
timestamp = conf1.get(key2);
filename = filenametimestamp".xml";
filename = filename.replaceAll( "-" ,"_" );
conf1.put(key1,filename);
return filename;
catch(Exception e)
     String exception = e.toString();
      return exception;
Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute that are required to be captured during run time. In our case File Name and Source File Time Stamp are required to be checked
In the receiver communication channel Mention u2018 * u2018as File Name Scheme.
Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute u201CFile Nameu201D which will carry the modified value in the UDF .
i hope this will help you.
Monica

Similar Messages

  • File Receiver Adapter(File Content Conversion)

    Hi All,
    If i open my file using notepad after File Content Conversion i am seeing a BOX kind of Symbol after Every Row ..
    but the same file if i open using word i am not seening that BOX ,,and the file is perfect ..can any plz tell what is the reason ... ?
    i gave<b> filedfixedlenght & Endsaparator</b> only
    is that i need to add any thing in the File Content Conversion parameters...
    thanks
    shakif

    Hi Mohammad,
    If I am not wrong "Box kind of symbol" would be "Symbol" for end of the line(EOL).
    In win-word if you click on "Show/Hide tab" You will see same symbols.
    Does it makes any problem while processing file?
    Let us know more details.
    Nilesh

  • Error when add seconds to Time Stamp format

    Hi,
    I've created a subVI that transform an string data/time to Time stamp format.
    The subVI seems that it works fine, but when I use the data 26/10/2014 and I add 1 day, it crashes! The result is 26/10/2014 23:00:00 instead of 27/10/2014 00:00:00.
    Cordially
    Vicen
    Solved!
    Go to Solution.
    Attachments:
    Convert Date-Time strings to Seconds.PNG ‏405 KB
    Sha Convert Date-Time strings to Seconds v2.vi ‏24 KB

    Thank you both!
    I think I've solved the problem.
    Vicen
    LV 2010/2011 on WinXP/Win7
    Attachments:
    Sha Convert Date-Time strings to Seconds v2b.vi ‏26 KB

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • Add time Stamp format in File Adapter

    Is it possible to change Add Time Stamp format ??
    If so please let me know the procedure to chnage it..
    It is scenario with no mapping so i cant go either Dynamic configuration or Variable substitotion.
    Thanks & Regards,
    Polas

    Hi,
    I think you need to assign it dynamically as you cannot change the format for Add TimeStamp
      See the below links:
    File Adapter: Dynamic file name
    /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
    http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm
    Thanks,
    Tiny

  • How to include seconds and millisecon​d in the CSV file time stamp generated by the SpreadShee​t Object?

    I'm Using Lookout 6.02, in a XP Pro Windows Machine, Service Pack 3.
    I have an application that collects data at the rate of 20 samples per second. It works just fine, the CSV File contains all the samples without missing a single one.
    The problem is that the time stamp in the data file only shows hours and minutes. With 20 sample per second, there are 1200 samples per minute. It is hard to figure out in which second or sample number, occurred some events collected. These files are open with Excel and analyzed with Excel. There is no easy way to implement a search or a guidance for knowing the sample number or the exact time in Excel.  My problem is to add the seconds and if possible the milliseconds to the time stamp done by the spreadsheet object.
    Any suggestion?
    Other ways to do the same that includes the time stamp all the way down to milliseconds?

    Create another column with the Now() function, then set the calumn format to hh:mm:ss.s
    expression would be now(trigger) for the date and time or now(trigger)-today(trigger) for just time
    The trigger will cause the expression to stay updated, perhaps using the same trigger for logging the spreadsheet.
    Good luck
    Mike
    Message Edited by Mike@DTSI on 01-16-2009 04:12 PM
    Mike Crabtree - Lead Developer
    Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
    (866) 964-6948 / (760) 247-9512

  • File Receiver Adapter - time stamp in front possible ?

    Hi all together,
    is it possible with the file receiver adapter to add a time stamp in front of the filename?
    f.ex. <timestamp>_SUFFIX.dat
    With file creation mode "use timestamp" and file name scheme
    SUFFIX_.dat it will create
    SUFFIX_<timestamp>.dat     .
    Thanx a lot for your help
    regards
    Hans

    Hi,
    This is not possible in the communication channel, but if you want to add date time stamp on the filename, you can use dynamic configuration. For that you have to write an UDF in the message mapping concatenate the date tme stamp with the filename and extension.
    In the communication channel you need to check on the message attributes so that when the adapter framework is called the filename generated in the message mapping would be used by the adapter. In the communication channel remove the filename and put * in the filename, as filename is one of the mandatory parameters in the comm channel.
    Regards,
    Indranil
    Award points if helpful

  • Adding time stamp while archiving the file in b2b

    Hi
    I want to add the time stamp when archiving the file when I am using file/ftp channel. can anybody tell me how can I do that. otherwise it is overwriting the exising file in archive directory.
    Thanks
    Sri

    Hi Sri,
    otherwise it is overwriting the exising file in archive directory.It might be happening because inbound files are not having unique name. You have two options -
    1. Make sure that inbound files have unique name (you may add timestamp in inbound filename format)
    2. Do not use the archive feature of Oracle B2B. Instead use a transport callout to write a copy of incoming document into desired directory with desired filename. To know more about callout offering of Oracle B2B, please refer -
    http://docs.oracle.com/cd/E28280_01/user.1111/e10229/callouts.htm#CHDEFBDG
    Regards,
    Anuj

  • Excel time stamp format mismatch

    Hello all, 
                                          I am writing time stamp into an excel file. Time stamp for time 2013 & 2012 appears different although format & method of writing is same in both the cases.
    In the attached file below. When time stamp is 2012 then format of time stamp in excel file & in input is same but when time stamp is 2013 then format of time stamp what i am writing actually & what appears in excel file is different.
    Dont know where exactly it is going wrong ?
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    Time stamp format difference.jpg ‏102 KB

    Ranjeet_Singh wrote:
                                Cell formatting is same in both the files, I tried entering directly & results are same.
    Thats what my question is ?
    Just to be absolutely certain I understand you: when you type a date in 2013 into an Excel sheet, it displays differently than when you type a date in 2012 into the same cell in the same Excel sheet. Is that correct? If you did this with two different files, try it with a single file.
    If you see this behavior when you enter the text directly from the keyboard, why are you posting it in a LabVIEW forum? It doesn't seem to have anything to do with LabVIEW.
    Why can't you upload your Excel files that demonstrate this behavior?

  • Display of Time Stamps based on the TimeZones

    Hi experts,
    I am new to Internationalization topic and wants to
    display Time Stamps based on the TimeZones.
    For example, If I choose Asia/Calcutta as my TimeZone
    it is displaying "Mon Aug 28 11:02:47 GMT+5:30 2001" as the TimeStamp.(I am in this TimeZone,which is default to me.)
    Similarly If I select any other TimeZone, it should display the TimeStamp in the same format but the values in the Time Stamp should reflect the selected TimeZone.
    I will be thankful to you if u could help me to get the solution.
    Srinivas.

    Hi Srinivas,
    It comes down to some tinkering in the java.util.* package.
    First off, you'll need to familiarise yourself with the Calendar class. This basically replaces the old Date class from old versions of the JDK, and allows you to hold certain dates and times. You can get one by calling Calendar.getInstance();
    You can then set a TimeZone on this Calendar by calling myCalendar.setTimeZone().
    To create a basic TimeZone, have a look at the SimpleTimeZone class - it'll allow you to set the hours ahead or behind GMT, as well as a start date for this time zone, and even gives the ability to add daylight savings time.
    From there, the time zone you add to the Calendar should produce the correct dates for you. Changing the time zone within a Calendar that already holds a date and time should alter that date and time accordingly.
    If you want to get really clever, have a look at the Locale class - it allows you to specify a default language and country. You can then apply this to your Calendar by calling Calendar.getInstance(Locale myLocale) instead of the version above. If you have the international JDK (i.e. the one with i18n.jar onboard), Calendar should be clever enough to format the dates nicely for you if you use a fairly well-known Locale (such as American English and so on).
    A Locale will also let you format dates in a location-specific way if you want to output them to the screen later on down the track. A quick look at SimpleDateFormat and some of the other DateFormat classes should tell you what you need to know.
    If you can't quite get your head around any of the above, feel free to reply again!
    Martin Hughes

  • Add time stamp array into first column of text file

    I am writing daq output to a file by using array to spreadsheet string vi then write that to a file but I would like to add a time stamp array into the first column of the text file. How do I do this?

    When you use a DAQmx Read, you have the option of returning a waveform data type. This includes time data. If you were to use this and either Export Waveforms to Spreadsheet File or Write Measurement File, this would included. To stick with the regular Write to Spreadsheet File, you would have to create an array of timestamps yourself based on a start time and the sample rate of the DAQ. Then you would convert this and the data array to strings and use the string array type of Write to Spreadsheet instead of the DBL type.
    Message Edited by Dennis Knutson on 09-25-2007 01:12 PM
    Attachments:
    Write to Spreadsheet - Strings.PNG ‏1 KB

  • Geotagging / GPS Metadata Time Stamp Format

    I have a photo/image taken on an iPhone. The GPS information in the Preview application (inspector menu) shows a Time Stamp of 11:10:56.63. Can anyone explain to me what the ".63" at the end of the time stamp format represents? Thank You.

    An obvious decimal point after a number has been the standard format to display tenths, hundredths and thousandths for hundreds of years. It's ridiculous that it has to be 'proven' in a court of law and can't be taken at face value for what it obviously is to any educated person. Ask 1000 high school educated people what a decimal point looks like and what it means and I'm sure you'll get 1000 correct answers. One more reason for my extreme dislike of what lawyers have done, and are doing, to our society.

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

  • Time Stamp Format

    I'm trying to insert a record into a field that has a time stamp format. Can anyone help me?
    Here's the SQL:
    insert into database.table (field1, field 2, etc., LOADDATE)
    values(field1, field 2, etc., 2002-09-13 00:00:00)
    The error message returned is literal does not match format string.
    I've tried multiple date formats without success.
    Thanks

    To clarify:
    Table layout
    FLD1 NUMBER
    FLD2 VARCHAR2(10)
    LOADDATE DATE
    Trying to insert following data
    FLD1 = 1
    FLD2 = 'ONE'
    LOADDATE = 2002-09-13 00:00:00
    insert to your_table (FLD1, FLD2, LOADDATE)
      VALUES ( 1, 'ONE', TO_DATE ('2002-09-13 00:00:00', 'YYYY-MM-DD HH24:MI:SS') )  ;

  • How do I set a custom time & date format in the top bar?

    Hello guys,
    Very embarassing question, because I've had Apple's for all of my life (starting with the original Apple Macintosh) but I still haven't figured out one thing
    How do I set a custom time & date format in the top bar?
    When I go to System Preferences > Language & Text > Formats I can set different formats. I have no idea where you will see these, but I know that it's not the top bar where the time and date is being displayed. Because no matter what I enter, the format in the top bar will stay the same. I can only choose things like 24-Hour clock or not, blinking dots and so on in the Time & Date settings from the System Preferences.
    Can anyone here point me in the right direction? I see you can even choose to display the week of the year - I'd love to do that!
    All help appreciated!
    Greetings

    Language & Text system preferences, Formats tab, customize dates.
    There are also many third party menu item utilities that can.  Search Macupdate.com for some.
    One search yielded iClock Pro.  Although I never used it I would think it allows customization.  The link I gave you is to the Macupdate download page for that app.  On that same page is a Similar Software section which has other apps that can do the same thing. 
    One listed is iStat Menus.  The primary use for iStat Menus is not for displaying date/time but it does do that.  And I know it can do what you want because I use iStat Menus to track temperature sensors n my machine and, like you, I want to customize the menu time/date.  So I use it instead of the apple clock.  It does have the customization features I think you are looking for.

Maybe you are looking for

  • Copy controls from quotation to contract

    Hi, My client want to create contract w.r.t quatation. I maintained the copy controls for the same but target quantity is not getting updated in contract w.r.t qutation 2)while creating contract without reference order quntity is not getting updated.

  • Added try it activity.. unable to track the course in Captivate 8?

    Hi, I am using Captivate 8 version, I am tracking my course via Slide count. I have try it activity in my course. I am facing the following issues in tracking the course completion. If the learner answers the try it correctly in the first attempt its

  • Unable to decrease partition

    In 2012 I used bootcamp to get windows 7 on my macbook pro 8.1, running Lion. I was able to resize the partition at any time, over the last year windows 7 has become less needed and frankly it's a sucky OS anyway even compared to XP so I'm happy to r

  • The size of the vault is only a fraction of the size of the library

    There are about 3,000 photographs in the library. All masters are relocated to an external hard drive. The size of the masters is about 34GB, which should be correct. However, the size of the vault is only about 5GB. This does not make any sense. Do

  • My Ipad mini locks itself while i'm still playing..I need some help _

    While I'm playing/surfing the net, my ipad mini randomly locks itself, and when I press the home button...it's locked...what was the problem there? Can anyone help me? Coz it's annoying >_<