How to validate for proper date format

Hi Experts,
I am using following Fm to calculate date difference.....
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from = wa_draw-zdm_vld_to_dat
        i_date_to   = sy-datum
      importing
        e_days      = v_days.
    if sy-subrc = 0 .
      if v_days > 0.
But value of field  zdm_vld_to_dat (data type DATS  , YYYYMMDD)   in database tables itself is wrong   ...like  ct/-0/29-o
I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.
So can anybody tel me How can I detect or know this fields zdm_vld_to_dat  conatins wrong date other than YYYYMMDD...e.g.
ct/-0/29-o   means any charecter or hyphen
Thank you.  

Hi Nilesh Hiwale,
1. First thing is there is no need for any function module for difference between two dates
    See this.
Data:
days type i
date1 type wa_draw-zdm_vld_to_dat
date2 type sy-datum.
days = date2 - date1.
Write / days.
                      > (OR)
2. write this condition in PAI module of your screen.
At selection-screen.
if date1 cn '1234567890'. or date2 cn '123456789'.
  write e000(Sabapdocu) with 'Enter YYYYMMDD Formate'.
endif.
Reward if it is useful,
Mahi.

Similar Messages

  • How does one change the date format for PlayMemories Home folders?

    I am using PlayMemories Home Version 2.0.00.11271 and have many folders within it which contain only photographs imported from my Sony DSC-H9.  Unfortunately, PlayMemories Home insists upon dating all folders in a month/day/year manner; and this makes little sense if one wishes to have the folders listed in logical chronological order.  How can I change the date format to year/month/day?  Changing the name of each folder, one by one, will take a very long time!  Your helpful advice in this matter will be greatly appreciated.  Thank you. System information:
    Operating system: Microsoft Windows XP Professional
    Service pack : Service Pack 3
    Memory: 1.5 GB
    Processor:         Intel(R) Pentium(R) M processor 1.86GHz
    Max. clock speed: 1.86
    Manufacturer: IBM
    Model: 1847W76
    System language setting: English (United States)
    User language setting: English (United States) 

    I too thought that the folder naming format was obviously wrong and couldn't find a way to change it. I do agree that placing photos in folders according to when they were taken is a great idea. I had been considering writing some software to do just that. After discovering that PlayMemories does it, I had it re-import all my photos. Then I wrote a small Perl script to rename all of the folders into year-month-day format. Included here is the Perl script. It only acts on a single folder - use it on the root folder where all the PlayMemories folders are. It will rename all folders currently in a month-day-year format. I used it without problems but of course there is no guarentee that it is error free. This should work with any common version of Perl. Tom # There should be one command line argument: the directory to act upon
    if ( scalar(@ARGV) == 0 ){
     print "Usage: RenameDirs <dir>\n";
     print " Where dir is the directory containing the directories to rename.\n";
     exit;
    $mydir = $ARGV[0];
    chdir $mydir or die "Couldn't chdir to $mydir: $!";
    opendir(ROOTPHOTODIR, ".") or die "Failed to open the pictures directory $mydir: $!";
    @allphotodirs = readdir ROOTPHOTODIR;
    closedir ROOTPHOTODIR;
    foreach $dir (@allphotodirs) {
     if ( -d $dir ) {
      print "$dir is a directory";
      if ( $dir =~ /^(\d{1,2})-(\d{1,2})-(\d{4})$/ ) {
       print " and has the proper format: month $1 day $2 year $3 and will be renamed to ";
       $newname = sprintf "%4u-%02u-%02u", $3, $1, $2;
       print "$newname\n";
       rename $dir, $newname or die "failed to rename $dir to $newname: $!";
      else {
       print " but is not of the proper format\n"
     elsif ( -f $dir ) {
      print "$dir is a file\n";
     else {
      print "$dir is neither a directory nor a file\n";
    }

  • Is there any system variable for this date format 01/21/2004 18:00:32

    Hello,
    Is there any system variable for this date format 01/21/2004 18:00:32
    This is my Internal date format and my External date format is sy-datum.
    How can I validate....any suggestions will be apprecaited!
    Regards,
    Kittu

    Hello,
    Thank you very much for your response!
    My internal date format is 01/21/2004 18:00:32
    and external date format on selection-screen is sy-datum.
    My external format is stored in S_crtsp
    and internal format is stored in L_crtsp. (01/21/2004 18:00:32)
    I want to remove the time from the internal format and validate it aginst the external format.
    Any suggestions or brief explonation is appreciated...I apprecaite the help soo far...
    Regards,
    Kittu

  • How can we give the Data Format (File Type ) in Runtime

    Hi all,
    How can we give the Data Format (File Type ) in Runtime for the following method,
    cl_gui_frontend_services=>gui_download.
    Thanks in advance
    Sri

    There is a filetype parameter which you can set
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
    *    BIN_FILESIZE              =
        filename                  =
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      changing
        data_tab                  =
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?

    Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?  I can't seem to change it from the short date format.

    Hi,
    I would suggest you to change the form language to English (UK), Here are the steps:-
    1. Open your form in FormsCentral
    2. Clik on Options tab
    3. Click on Language and Formatting and check out the selection for Form Language and make sure English (U.K.) is selected and the default date format should be day/month/year.
    Regards,
    Nakul

  • How to update the default date format in OBIEE 11G.

    Hi All,
    How to change the default date format in OBIEE 11g from the MM/DD to DD/MM. Could anyone please help me out ASAP?
    Thanks,
    Arpan

    Hi Arpan
    OBIEE 11g is having " localedefinitions.xml " file at this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display
    in my case i installed at C:\Oracle\MIddleware.
    so
    1- Stop BI Server from EM
    2- Navigate to this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display. in your case oracle home will be different
    3- take a backup of this file localedefinitions.xml "
    4- modify it and save
    5- bring BI Server up.
    Regards
    sher

  • How to convert milliseconds to date format in sql query

    Hi All,
    The following code is in java.     
    String yourmilliseconds = "1316673707162";**
    Date resultdate = new Date(Long.parseLong(yourmilliseconds));
    could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)

    Hello,
    http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
    Regards

  • How to eliminate # for empty date value in BEx Analyser

    Hi Gurus,
    Can any one please let me know how to eliminate # for empty date value in BEx Analyser.
    Thanks in advance
    peter

    Hi
    add the following macro to your workbook (template workbook):
    Sub SAPBexonrefresh(qstring As String, resultArea As Range)
    For Each c In resultArea
    If LCase(c.Value) = "not assigned" Then c.Value = ""
    Next
    End Sub

  • How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    Date, time and currency formats are controlled via Settings > General > International > Region Format - you can't just change the date format

  • How to get Default (System) Date Format Pattern?

    How to get system default date format which is defined in Regional Setting of Control Panel.
    We can get an instance of DateFromat using DateFormat.getDateInstance(DateFormat.SHORT) but problem is that there is no toPattern() exist in class DateFormat.
    However toPattern() exist in class SimpleDateFormat but there is no costructor like SimpleDateFormat(DateFormat)
    So please advise me, how can I get system short date format pattern?
    Thanks
    GAJESH TRIPATHI

    I reterieve the system date format but not which is currently defined in regional setting of control panel but it returns the format which is installed by default when windows(os) is installed.
    Edited by: gajesh on ? ????????, ???? ??:?? ?????????
    Thanks to provide me solution. My source code related problem is solved but still I am not getting format which is defined in control panel. but By Letting that it is not possible in Java,... I am doing my next work...so CLOSE THIS TOPIC Thanks'n Bye.

  • How to convert parameter in to proper date format in unix.

    My requirement is to convert parameter string (012011) as a date in unix without support from other like sql. then once it is converted into date format how to increment it by one day. Here i want to use my own date rather than system timestamp of unix system. Please help.
    I am unix HP unix 11.

    Moderator Action:
    Your question is outside the scope of this Linux forum space, and is locked.
    You seem to hope for assistance with a specific Unix that is a product from a specific company.
    I suggest you go to that company's forum community and ask there.  You will undoubtedly find many people there that are familiar with the nuances if that OS.

  • In Thunderbird, how do I change the date format for the column display?

    I want the date to show as DD-MM-YYYY HH:MM AM/PM. Although this should be really obvious (and I know I've done it in the past), I can't find where to do this and can't find anything in Thunderbird Help on this, not even when I search "Thunderbird, change date format".

    Thunderbird usually uses the computer date and time and settings.
    I'm using Windows and notice that TB is using the short date format which I set up under Regional & Language Options.
    Are you using the International settings or Date/Time settings?
    It should pick up the settings from the 'International' or maybe its called now called 'Language & Text' setting.
    not sure which of these suits your macbook:
    http://www.macyourself.com/2008/08/31/modify-the-default-clock-in-os-xs-menu-bar-to-show-the-full-date/
    http://www.dummies.com/how-to/content/language-text-preferences-on-your-macbook.html
    http://www.dummies.com/how-to/content/how-to-change-your-macs-date-and-time.html
    http://www.youtube.com/watch?v=2zBMl8Vb3wc
    http://support.apple.com/kb/TS3579

  • How to validate inserted xml data in oracle is correct or not

    (i.e.how to validate xml syntax and tags are correct)
    XML data has been inserted in Oracle database.Once inserted
    I want to validate that data entered and tags inserted are correct
    or not.
    Pl help

    Some small remarks after a life time of write that small notepad.
    Don't use XMLIsValid() - Apperently it was once ment for use in table constraints only AND the most annoying part, it doesn't give you a proper error message.
    More usable is schemaValidate() - it throws a useful error message... I never came around to update that post or write a proper one while using schemaValidate().
    I would be against advising / using a Java wrapper to achieve this goal unless you are on a pre 9.2 database version. Registering, validation and such is optimized (in memory) in Oracle from the beginning in 9.2.0.3 and onwards to avoid for instance reparsing of the XML Schema itself. If a XML Schema is registered a lot is optimized including DOM, which will be avoided and "outsmarted" by using XOB objects (see the Oracle manuals only a few hits and those will point you directly to the optimizations at hand).

  • How to get a correct date format

    Hi Experts,
    I fetched a record from the table KALV. Here its showing the date format as DD.MM.YYYY. But in my internal table and my output its showing YYYYMMDD.
    How to solve this?
    Actually this report needs to show the output as per the user's format. Because may have different format. Accoriding to there format it should show the output.
    How todo this?
    Anyone guide this?
    Mohana
    Moderator Message: Basic Question.
    Edited by: kishan P on Feb 3, 2011 4:14 PM

    Here's a sample of the code:
    [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4];
    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    [dateFormatter setDateStyle:NSDateFormatterShortStyle];
    NSDate *date = [ dateFormatter dateFromString:@"7/4/2008" ];
    NSLog(@"string from date %@: %@ for locale %@", date, [dateFormatter stringFromDate:date], [[dateFormatter locale] localeIdentifier]);
    (the same code without the messed up forum syntax is at http://pastebin.com/f695ef95b)
    When I set my region (in the International system preferences) to be United States, it prints:
    2008-08-14 20:20:31.117 Date Difference[17226:10b] string from date 2008-07-04 00:00:00 -0400: 7/4/08 for locale en_US
    And when my region is United Kingdom, it prints:
    2008-08-14 20:19:23.441 Date Difference[17199:10b] string from date 2008-04-07 00:00:00 -0400: 07/04/2008 for locale en_GB
    It looks like the NSDateFormatter is insensitive to the change of regions. Notice that the raw printing of the date is properly switching with the region, though.
    What do I have to do to get the NSDateFormatter to respect the region setting?

Maybe you are looking for

  • I have multiple devices, I can share itunes music but not my apple apps.

    I have an imac, ipad and three iphone 5s.  I can share my itunes music but not my apps.  All three iphones have separate Apple id's.  Thanks

  • Business Package for Land Management?

    Hi Gurus, Is there any Business Package for SAP Land Management? If SO please let me know the Name and Version number? Also If anybody has Portal Implementation experience in this module Kindly give me some documents............................ Thank

  • Side Effects of not installing Java/XDB

    Hi, are there any side effects known (10g/11g), when not installing one of the following options: Spatial Oracle interMedia OLAP Catalog Oracle XML Database Oracle Text Oracle Expression Filter Oracle Rules Manager Oracle Workspace Manager Oracle Dat

  • Feature Request: Make a Setting Option for Export - Media - What to Render

    As I just changed after many years with Premiere Elements to Pro, I certainly find many things just anconversant. But there's one thing I really can't take: When I'm trying to render a project, there's a small selection list near the bottom of the "E

  • Finger print reader & WWAN facility

    Hi, I have a HP6930p laptop four year old. I had reformatted the and reinstalled the windows and related software, now when I go the register my finger swipe the respond is already registered. I've tried several time but result is the same. Anyone ca