Date check

I have to check if a string is a correct date. I have already checked topics about this in the forum but all of them talk about formatting string as a date.
In other words if I have a string like dd-mm-yyyy how can I control if it is a real date or not?
For example 99-01-2003 is not correct but if I check only the format it is OK.
Is there a class that can do it?
I'm sure of that but I haven't found it.
Thanks in advance.

You can make use of java.text.SimpleDateFormat to perform verification of the Date
import java.text.SimpleDateFormat;
import java.text.ParseException;
public final class DateTest {
  // The Date Format to be used to verify the String
  private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd");
  // Set the Date Format to be non-lenient. This is what determines
  // if a date is valid or invalid
  static {
    DATEFORMAT.setLenient(false);
   * The Main Method
   * param args The Arguments from the Command Line
   * @since 1.1
  public static void main(final String[] args) {
    if (args.length != 1) {
      System.out.println("Usage : java DateTest <date>\nDate must be of the format \"YYYY-MM-DD\"");
    } else {
      try {
        DATEFORMAT.parse(args[0]);
        System.out.println("\"" + args[0] + "\" is Valid");
      } catch (ParseException e) {
        System.err.println("Date Could not be parsed Successfully. " + e.getMessage());
}Please note that SimpleDateFormat is not thread safe. If you need one that is thread safe, you can consider FastDateFormat from the jakarta commons project at http://jakarta.apache.org/commons/ . The FastDateFormat class is from the Lang component
Hope that helps
Jega

Similar Messages

  • Credit Limit VS Posted Date Check

    Dear Experts
    Our client have a requirement on customer credit limit and I would like to seek for some good solutions.
    Here I provide one sample scenario: In SAP Business One a customer with a credit limit of $100,000 and account balance of $110,000. After a posted date check of $20,000 is deposited, customer account balance will be reduced to $90,000 and a Sales Order/ AR Invoice with amount less than $10,000 can be added for that customer without credit limit alert.
    However, our client thinks that it is not make sense to reduce the customer account balance given that a posted date check is deposited as the posted date check may not be cashed if the customers do not have money in their account.
    Would it be possible to separate posted date check payment amount from deducting the customer account balance? or would it be other workarounds?
    Thank you very much
    Regards
    Elton

    Dear jbrotto
    Thanks for your reply.
    Could you explain in details on how to make use of the commitment limit?
    As far as I know, commitment limit also considers the account balance of customer
    Regards
    Elton

  • Due date checking in F110

    Hi,
    My client want to use F110(Automatic outgoing Payment) to payment the vendors. But they want to avail Credit for at least 30 days .that means , those invoice process had been done before 30 days those should come to the APP PROPOSAL FOR THE PARTICULAR VENDOR,OTHER WISE NOT TO BE SEEN IN APP PROPOSAL  Is there any provision given in FBZP ?
    <removed_by_moderator>
    With Regards,
    Sudipto

    Dear Paul,
    If you want to check Due date then there is no setting in FBZP but at the time of running APP through T.code F110 , while defining payment proposal parameter there is 4th no. tab page with name 'Additiona Log' . in this tab page there is first option Due date check you tick on it and system will check due date for all vendors and customers which you have selected for Payment.
    thx.
    Ganpat

  • Batch expiration date check when goods issue

    Dear expert,
    In batch expiration date check, we have a requirement that when do goods issue with delivery note we should have a expiration date check for expired batch(the system needs to give a warning message when we want to pick a expired batch(in WM) or to issue a expired batch). But I checked OMJ5 and found that there is no check for movement type 601, 641, 643 or 647. Do we have a standard function for this requirement? Thanks.
    Leo

    Hi,
    In SD batch determination normally happens during Delivery creation for a Sales Order, Check for batch determination is maintained for a combination of sales org, order type - system determines Search Procedure at this level (here a check box also controls the batch check against selelction rules in case somebody puts a batch manually)
    later on through selection class and sort rules batch expiry is check during determination
    so all checks are applied before an actual goods issue is made so std SAP doesn't provide this check indicator at mvt type level
    Hope this helps
    Reg
    Dheeraj

  • Web Dynpro ABAP ALV On Data check

    Hi
    If i push the check button and i find an error in my on data check event and send an error message l_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE. It will not check again when i am pushing of the check button again, i guess because no data has been changed. But if no data has been changed, the user will not have cleared the error for sure.
    Now as i write this i have an idea for an work around.
    But anyway. It seams to me that others should have faced this problem and i believe i am doing something wrong. I have tried to set the value again, but this will not trigger an change.
    So what i will try next is to save my error messages and just clear them when the data_check is done again. (I am not sure how to do this at the moment, but i will see.)
    Still does anybody know a better way, or how it's meant to be done?
    thanks.

    my solution is:
    on the data check event i save the changes to tables in my class.
    i have put an own check button in the alv, which is realy checking the data.
    the save button is then using my tables to do the actual changes to the dso.

  • Exit for delivery Date check in Sales order [Via EDI]

    Hi Friends ,
    We have a requirement in which if the Sales Order is created Via EDI with INVALID delivery date then I have to set a flag in some Z Table . I have tried searching for exits and debugging the code but was unable to find a place where SAP checks for delivery date validity . Please help me with possible exits/Badis?Enhancement Pts etc where I can mark this flag .
    Thanks & Regards
    Gaurav Deep

    @Vinod Thanks  for your reply , the delivery date is there in EXIT_SAPLVEDA_009 .
    But how will i check if the delivery date is valid or not , If you go to VA01 and give a invalid delivery date a warning message is issued , here if the warning message is issued then I want to set my flag , this might save my from  coding redundant delivery date check logic , can someone please help me how can i track if this warning message is issued .
    Thanks & Regards
    Gaurav Deep

  • UCCX 8.0 SU4 Data Check

    I've just upgraded from UCCX 7.0 to version 8.0 this weekend and when I do a Data Check I get User and Network Audio Source -- UUID cahnged from (long hex string) to (long hex) string.  This is also shows the same thing in the VoiceMailProfile section.  Any clue what's going on?          
    Thanks in advance

    Hi Lennie
    SU4 was originally scheduled for August, then October and according to the last Cisco post I saw on the partner forum its now mid December.
    All versions of 8.0(2) work with Windows 7 64 bit.
    Graham

  • POS DM master data check

    Hi all,
    is it possible to perform articles master data check (eg. ean code or article code existence) on sap retail master data instead of bw 0material?
    Thanks a lot
    Ado

    Hi Anthony,
    here some answers to your questions:
    1.) How does it check the existence of related master data? If you look at the details of a delta infopackage, you will not find an option to check for master data as compared to a normal delta infopackage.
    ==> you cannot check the refrential integrity via the InfoPackage, hence you have to this via transormations (if needed)
    2.)  Will it load the transaction data even if no master data exist for the transaction data?
    ==> Yes
    3.) Also in this process, will it create the master data SID table entries while it loads the transaction data into the DSO? There may be some master data referenced by the transaction data which may not exist in the source system yet and therefore not loaded into the master data infoobjects yet.
    ==> Yes, but this behaviour is the same as for periodic (non-RDA) transactional data loads.
    4.) The concern I have is when running a process chain to load master data such as 0ACCOUNT, 0COMP_CODE and followed by an Attribute Chain Run at the end of this process chain, will the locks established by this Attribute Chain Run crash the RDA daemon when it tries to load those transaction data that have new master data in them ?
    ==> You do not have to worry about conflicts / concurrent locks with the Attribute Change Run. The only process that could be critical, is the loading via RDA and periodic master data via DTP, which could result in a error in the DTP (you can resolve this very unlikely event by restarting the DTP or by triggering the re-load of  the master data from the source system). In general, we would assume that these 2 events are highly unlikely to conflict.
      Cheers
        SAP NetWeaver BI Organisation

  • I just bought an iMac and I´m a new user of Mac.  I captured my data and my country is Mexico. What can i do if the final data check show España? Is it important or it doesn´t matter?

    I just bought an iMac and I´m a new User of Mac. I captured my data and my country is Mexico. What can i do if the final data check of Mac shows Spain? Is it important or it doesn´t matter?

    Hola & welcome to the Forums!
    Have you noticed any problems, like Time zone or Time display?

  • Master data check not working when loading into and ODS object

    Hi guys,
    we are loading transactional data into an ODS from a flat file.
    In the infopackage, we have checked the option :                                                
    "Do not update data if no master data exists for a characteristic".
    This option seems to be unreliable :
    For some characteristics (it seems those loaded using transfer rules (routines)), incorrect data is still loaded into the ODS even if no entry exist in the associated infoobject master data table.
    Any help appreciated.
    Many thanks !
    Pierre-Yves

    Hi Dear,
       please delete all the incorrect master data from the master data characteristic first and then try to uploading the data again .It should work, because there migth be some master data created when data were loaded with out the check before.
    And please check whether all your characteristic info object are of master data , I mean that in the infoobject defination you have checked the master data check box on the info object. If you have only text then it might fail the master data check.
    hope this help.
    cheers,
    balaji
    Message was edited by: Balaji NS

  • I want to disable certificate date checking

    I want to disable certificate date checking because I set the computer to always be at a specified time that does not match with the real time.

    Hi,
    About the question, I suggest that you can post it in network forum where you can get better answers.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Date checks

    How do I do a date check?
    I have an HTML form which has field for a start date adn finish date of a project. How do I check so that the finish date is after the start date? What I mean is that I can't have a project that starts after its finished!
    I've had a look at .compareTo but get errors with it.
    Thanks
    Michael

    I have a check which uses a taglib to send the user back a page if the if statement is satisfied.
    This is one of the IFs to check the finish date that I tried but got errors.
    <%if(efinish.compareTo((Object)start) == 0){%>
    <go:Back alert="Make sure that the finish date is later than the start date!"/>
    Thanks
    Michael

  • Bursting program errors when no data - Check output before bursting

    Hello experts,
    I have a XML Publisher Report with a Data Template + Bursting Control File.
    This works perfectly when there is data.
    But, when there is no data, main concurrent program completes successfully but the Bursting concurrent Program errors.
    This is mainly because I am selecting the email address dynamically based on the data.
    + Is there a way I can check the xml output before submitting bursting program from PL/SQL package.
    Log file does not show any error:
    Here is the content of the log file for reference:
    XML Publisher: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XDOBURSTREP module: XML Publisher Report Bursting Program
    Current system time is 09-OCT-2012 11:38:06
    XML/BI Publisher Version : 5.6.3
    Updating request description
    Retrieving XML request information
    Preparing parameters
    Set Bursting parameters..
    Bursting propertes.....
    {user-variable:cp:territory=US, user-variable:cp:ReportRequestID=2669035, user-variable:cp:language=en, user-variable:cp:responsibility=25182, user-variable.OA_MEDIA=http://hcc-928.hullcc.gov.uk:8045/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=, user-variable:cp:parent_request_id=2669035, user-variable:cp:locale=en-US, user-variable:cp:user=DURBHAKAV01, user-variable:cp:application_short_name=XDO, user-variable:cp:request_id=2669036, user-variable:cp:org_id=83, user-variable:cp:reportdescription=XXHCC OLM Course Confirmation Letter}
    Start bursting process..
    Bursting process complete..
    Generating Bursting Status Report..
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Thanks
    Vinod
    Edited by: Vinod on Oct 15, 2012 1:52 PM

    Follow up update:
    I have applied the patch 8594771 ( p8594771_11i_GENERIC) but there is no difference.
    Error still exists.
    Checked the OPP log but not much help there.
    OPP logfile shows this error:
    org.xml.sax.SAXParseException: <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
    Any inputs??
    Thanks,
    Vinod

  • Subtype Validity Start date Check

    Hi All,
    For one of the infotype we created a new subtype with the validity in future date say 01102010.
    Now if i go to infotype i am able to create the record for this new subtype with the start date as 01042010 which should not be allowed.
    I checked the table V_T582A and also the time contraint for the infotype.
    Time constraint for the infotype depends upon the subtype and in the subtype table it is mentioned as 2.
    I know that we have the custom check for the infotype but is it possible through stadard settings
    Pls guide me on this
    Regards,
    Umesh Chaudhari

    Hi Umesh,
    Though the subtype table for 0071 (Pension funds GB) is V_T591A; it also reads T5G30 to identify the schemes..
    Table T5G30 in turn has got various Pension Schemes with Start Date/End Date.. If you Start Date and End Date of the Plan is in Future (01102010) and if you intend to maintain the new scheme (Subtype) from 01042010; an error is displayed..."Scheme XXX is unknown for this period; check pension table entries."
    Kumarpal Jain.

  • Vendor Master Data Check

    Dear Gurus,
    I have to configure certain checks for Vendor Master duplication checks.
    Can you please tell me the node in IMG and revent details for this config or if you can give the link.
    Regards
    Raju

    Hello,
    If I understand your questions correct, you would like to generate a pop-up list in case if you are going to create a vendor or customer master record with the same name.
    You can do this by:
    IMG ==> Financial Accounting ==> Accounts Receivable and Accounts Payable ==> Vendor Accounts ==> Master Data ==> Preprations for Creating Vendor Master Data ==> Change message control for Vendor Master Data
    Give message numbers 144 and 145
    Put I (Information) for Online as well as batch.
    I would not recommend you put E (Error) as there are possibility that there may be vendors or customers with the same name exists in your business.
    Hope this solves your problems otherwise please let me know.
    Regards,
    Ravi

  • AP Posted data checks

    How can I print check with future dates in AP? Can this be done without opening the future periods?

    Thomas:
    So the only problem you have is the AirMagnet alarm?
    I never worked personally with AirMagnet but you better check the settings if there are defined data rates?
    I think the message says the AP has 48 and 54 Mbps data rates enabled while the AirMagnet is not configured to allow those data rates.
    Just an idea. hope it helps.
    Amjad

Maybe you are looking for

  • Zen Vision M 30Gb and Windows 7

    Hi. I have problem with my player. I installed windows 7 and zen media organizer 5. Windows and windows media player 2 detect player. If I want transfer music to my player by creative organizer, organizer writing ,,No Creative MP3 player is detected.

  • Service Tax credit posting not happening at the time of Service Entry sheet

    Hi I am accepting (releasing) service entry sheet of some services. Entry was posted: Service Expense A/c.. Dr To SR / IR A/c... As per new service tax law, we can take credit at the time of accrual of services i.e. at the time of accepting service e

  • How to use scrollInToView method in Adobe edge animate

    I would like to use scrollInToView method in one my long pages, but I can't seem to invoke this code, any help would be greatly appreciated.

  • How can I extend the  JCA File Adapter

    I would like to extend the JCA File adapter. I want to overcome the file size limit of the File Adapter. I want to the JCA Fileadapter to have the following functionalites. 1. Split a file into smaller chunks, The chunk size will be set at design tim

  • O-R XMLtype versus relational table storage with XMLType

    Hi, I am working on a application which centers around ingesting/storing, editing and publishing a huge XML file (spanning several days of a calendar). I am confused as to whether I should choose to store the XML as O-R XMLType (by registering the sc