Date validation and ParseException Problem

I take in two dates in string format("start","stop") from the user.I am trying to validate them,but i dont know
why it's not taking in the default values which i am trying to give if it throws an exception,infact it directly
goes to the throw statement.Can someone tell me where i am goin wrong??java.text.SimpleDateFormat sdf =  new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date d=null;
Date d1=null;
try{
sdf.setLenient(false);
d = sdf.parse(start);
d1 = sdf.parse(stop);
}catch(ParseException pe){
start = "2005-02-13 00:00:00;
stop ="2005-02-14 00:00:00;
out.println("DATE ENTERED WAS INVALID-DEFAULT VALUES SHOWN");
throw new IllegalArgumentException(pe.getMessage());
}

Before throwing the exception, there is no logic to process the default dates.

Similar Messages

  • Date validation 'validateDateTimeRange ' giving problem

    Hello Guys,
    We are using ADF 11g(11.1.1.2).
    Here we are trying to validate the date using validateDateTimeRange to validate the date.
    <af:inputDate id="dateLaborIt" required="true"
    binding="#{ClaimsBean.dateLaborPerformedI}">
    *<af:validateDateTimeRange maximum="#{ClaimsBean.currentDate}"*
    *minimum="#{ClaimsBean.purchaseDate}"/>*
    </af:inputDate>
    Occatinally this validation giving me problem when the min and max dates are equal.
    It is giving the validation error as:
    Error : The date is outside the valid Range
    the date must be between "6/25/2011" and "6/25/2011".
    Can any body help me in resolving this issue.
    Regards
    Ahamed

    This is the code that is being generated. The error is occuring on thie line
    var value = field.value;
    The problem is obvious, since the field does not exist it can't get the value... I would like to avoid having to write my own validateDate method..
    function validateDate(form) {
           var bValid = true;
           var focusField = null;
           var i = 0;
           var fields = new Array();
           var formName = form.getAttributeNode("name");
           oDate = eval('new ' + formName.value + '_DateValidations()');
           for (x in oDate) {
               var field = form[oDate[x][0]];
               var value = field.value;
               var datePattern = oDate[x][2]("datePatternStrict");
               // try loose pattern
               if (datePattern == null)
                   datePattern = oDate[x][2]("datePattern");

  • Data reading and writing problem? how to set " Read from Measurment File express.vi​" 's readout datasize?

    Dear all,
    I want to use Labview to process a data.
    Now I have a array in a text file.
    this array is very very big. which is at least row*col = 6 * 100000;
    the column size always 6,
    but the row size is ramdom, some times is very big, like bigger than 65535,
    when I use "read from measurement file express.vi" to read this file, the array I could get always 6*5339, I don't know why. the column size is always 5339.
    and then I delete the 1st row of the array and then write into a txt file via "write measurement file express. vi", it takes a very long time. almost computer has no response. after a while, no file was creat to record the data.
    is there an efficient way to process such big data file and store the processed file into a new file
    thank you very much
    Jack
    Message Edited by weichengatech on 03-09-2006 12:00 AM

    Hello,
    There’s no real efficient way to read the file if you don’t
    know exactly how many rows of data you have. 
    Your going to just have to read a row at a time and add the results to
    the end of an array (granted for the clever programmers there are some more
    efficient ways to do this than just with ‘build array’).  I would start by asking you how much
    information you know about the file and what the exact structure of it is (i.e.
    is it a binary file, a tab delimited file, or a LVM file)?  Could you provide a screenshot of the code
    you are running? If you provide a little more information on the file structure
    we might be able to contribute some additional information.
    Look forward to hearing back from you-
    Travis M
    LabVIEW R&D
    National Instruments

  • Japanese Data Set and Get Problem with SQL

    Hi,
    I am not able to retrieve or set data contain Japanese characters.
    Formerly our set up was running just fine. But on doing installation on a new machine, things have gone all haywire.
    I installed Win NT 4.0 Japnese version and SQL 7.0 and later Win 2000 Server Japanese version with same SQL 7.0, but on both get and set I get SQL Exceptions:
    Query 1:
    SELECT DISTINCT MAKER_CD FROM T_MAKER WHERE MAKER_NAME = '�a�l�v�A���s�i' Exception:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string '�a�l�v�A��'.
    Query 2:
    Insert into Car (intCarID, nvchCustomerID, nvchCarMaker, nvchCarModel,nvchCarDescription, nvchCarCode, nvchCarColor, tintRegistrationCalendar,tintRegistrationMonth, intRegistrationYear,nvchAnnualMileage, nvchPurpose, intNoOfKms,intAirBag, btEcologicalCar, btAntilockBreakSystem,btAntiskid, btSafetyBody, btAntitheft, btFourWheelDrive,btCarModification, nvchLicensePlateArea, intLicensePlateType,nvchLicensePlateHiragana, tintLicensePlateNumber,nvchCarManufacturingNumber, nvchCarOwner, btCurrentlyInsured)Values( 1, 'NI200205040001','','', '', 'HA11S', '���I����������',2,1, 11 ,'5000', '�����E���W���[',0,2,0,0,0,0,0,0,0,'',0,'null', '0' ,'', '�_�������{�l' , 0)
    Exception:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'null'.
    I do not wish to Prepared Statements. I will need to update all my JDBC calls this way.
    Would be grateful if any solutions to this problem could be provided.
    Tahanks and Regards

    If you are using the JDBC-ODBC bridge, then add the 'charset' property (with the name of the japanese charset as value, or whichever you are using) to the Properties instance you pass on to getConnection().
    Alin.

  • File Adapter : read XML file with data validation and file rejection ?

    Hello,
    In order to read a XML file with the file adapter, I have defined a XSD that I have imported to my project.
    Now the File Adapter reads the file correctly but it does not give an error when:
    - the data types are not valid. Ex: dateTime is expected in a node and a string is provided
    - the XML file has invalid attributes.
    How can I manage error handling for XML files ?
    Should I write my own Java XPath function to validate the file after is processed ? (here is an example for doing this : http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21058568.html)
    Thanks.

    one option is to specify validateXML on the partnerlink (that describes the file adapter endpoint) such as shown here
    <partnerLinkBinding name="StarLoanService">
    <property name="wsdlLocation"> http://<hostname>:9700/orabpel/default/StarLoan/StarLoan?wsdl</property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>
    hth clemens

  • [Satellite Pro A200] - slowness during data transfer and heat problems.

    Hi folks.
    I have a 1.5 y.o Toshiba Satellite Pro A200 with standard 200GB HDD. Since some time its behaviour is just... weird.
    Sometimes system slows. It just behaves sluggish, it frequently freezes for a second during simple tasks such as entering the text. It;s more frequent during intensive data transfers (such as copying files through FTP from my LAN or copying from pendrive) but sometimes it happens even when no other app than the Firefox is working. It's not that apparent, so I wonder - will service take it under warranty conditions (which means - is there a probability that they'll say that everything is perfect and charge me for this?)
    The computer was on the warranty repair once, they replaced HDD with other one. Is it possible that the other one has some troubles as well (S.M.A.R.T. check discovers nothing). Or maybe it's faulty SATA controller?
    Other thing is the temperature. During normal work (Internet, MS Word) both cores works at 60*C. When gaming the temperature can rise above 90*C and the computer sometimes shuts down. I assume that the problem is the dust accumulated inside the laptop but I can't see how can I clean it up.
    Would you go to the service with such problems?

    Virus scanners can slow a system down considerably, what Virus Scanner are you using?
    If you have many programs installed, maybe its time to backup your data and reinstall Windows. I do it myself every year since Windows tends to get bloated and slow after a while.
    As for the dust, you can blow it out using a Can of compressed Air sprayed through the main air vent (while the system is off).
    Or if the dust buildup is really bad, you may need to send it to an Authorised Service Provider to get it dismantled and cleaned up.

  • Data importing and exporting problem between BADI's

    Hi Experts,
    I am facing a problem in importing and exporting the data between badi's.
    I am able to import and export the data between DOC CHANGE and DOC CHECK BADI's etc; but now i have a requirement to map a field from SRM to R/3.
    Supplier order key field which is added to the basic data section of Shopping Cart should be mapped to the corresponding fields in R/3. I have added the field and when i am trying to map it to R/3  i am facing the probelm.
    This Supplier order key field will be coming from ZBBP_CATALOG_TRANSFER badi and i am trying to map it in the Z_BBP_CREATE_PO_BACK Badi; i tried by using the below statement to export a single parameter to PO BACK badi from CATALOG TRANSFER Badi
      EXPORT zsupp_ord_key FROM zsupp_ord_key TO MEMORY ID 'Z_SUPP_ORD_KEY'.
    which is not working.
      IMPORT zsupp_ord_key TO zsupp_ord_key FROM MEMORY ID 'Z_SUPP_ORD_KEY'. in PO BACK BADI.
    Can any one please let me know why this is happening?
    And i have strange problem in this ...
    when a user copies a catalog which is already created then we can not map the field to R/3 PO
    and again if he tries to create a cart by selecting "Old carts which are already created" we cant map field for the above two things to happen i think we need a custom coding .....
    Thank you
    Lokesh.

    Hi Lokesh,
    BADI implementations have classes for which an instance is created at runtime and hence the import and export memory logic will not work.
    Please try to create a function module for these BADI and call them in these BADI's. Then go ahead with the import and export logic. This could help.
    I would rather advice, to figure out an option to avoid this memory manipulations.
    Regards
    Kathirvel

  • IPod nano 5 date & time and screen problems.

    My iPod nano 5th gen. The screen has white lines going from side to side. And more and more keep appearing. Also when I go to change the date and time setting it keeps shutting off and restarting. I've tried to do a hard reset and it didnt work. Someone please help !!!!!!!!!

    I have sorted out the playing problems.
    However it's still not showing battery is charging either through usb or mains charger - although I can play music - but cannot switch nano off.  Any advice appreciated

  • No data Service and other problems

    My girlfriend and I recently updated to 3.1 and we're having no end of problems.
    Most of the problems are calls not going through. It takes around 4 - 15 attempts to actually get a call to go through and when it does go through it will drop within 10 - 20 minutes of being on the phone, sometimes within 1 - 2 minutes.
    We have had problems sending and receiving text messages.
    A lot of apps on our phones wont work properly either. It will give us an error asking to make sure our phones arent in airplane mode.
    We both have unlimited texts and data package. neither of our phones are on "past-due" with at&t and neither of our phones are hacked.
    Most of the time its our apps that arent working, it'll either not load or give us the error about airplane mode.
    This is very annoyoing. can anyone help?
    We havent downgraded because someone we know has 3.0 and its still a major issue.

    I've already chimed in, but thought I'd update. The problem got way worse for me yesterday. The phone shut down repeatedly (nearly hourly) all day long. It got hot around each time as far as I could tell. The phone also burned through battery life like never before. I needed to charge my phone midday and it was dead by early this morning despite very little usage.
    Today I did a full restore via iTunes (not as a new phone, just using my existing profile). Since doing that, I've been without any issues for over 9 hours, and the battery gauge has barely budged.
    Fingers crossed that I've seen the last of the issue.

  • 0material data deletion and uploading Problem

    Hi to all,
    I have already deleted the transcational data.
    and now I want to delete master data from 0material infoobject with SIDs option
    a information box will appear
    SOME MASTER DATA CANNOT BE DELETED
    and if u confrim the dialog box
    another dialog box will appear
    The system is unable to delete all of the specified master data, because some of it is still in use
    See log:Object RSDMD, sub-object MD_DEL
    and also if u delete without SIDs option
    still same the information will come.
    The system is unable to delete all of the specified master data, because some of it is still in use
    See log:Object RSDMD, sub-object MD_DEL
    can any one tell me why we cant delete complete master data.
    or is there any solution for that.
    also
    if i have loaded master data from R3 Quality to 0material infoobject and now i want to load the data from R3 production .
    so does i need to delete the previous R3 Quality data first before loading the R3 Production data in 0material.
    Does it will overright 0material  R3 quality data from R3 production data.
    and if R3 quality data is different from R3 production data , does still it will over right.
    Please cany any one suggest me what to do and why.
    I shall be thankfull to yo for this.
    Regards
    Pavneet Rana

    Hi Pavneet,
    Check the below points might help you
    As you said the system prompted u 'some master data cannot be deleted' .. continue with this message.
    Next goto tcode SLG1-- enter Object: RSDMD and Subobject: MD_DEL and User: ur userID and F8
    In the next screen Expand node and dbl click 'Problem class additional information'
    This will give u which ever objects using SIDs of this master data.
    U should delete this SID according to that list.
    Then U should delete particular data from DSO/Cubes.
    Once data deleted from cube, then
    Use Tcode RSRV -> Tests in Transaction RSRV -> All Elementary Tests -> Transaction Data -> Entries Not Used in the dimension of an InfoCube (Dbl Click)
    From the right side window, expand u201CEntries Not Used in the Dimension of an InfoCubeu201D Node &
    Enter InfoCube (like 0SD_C01), click u201CTransferu201D
    Now, click u201CExecuteu201D (Toolbar)u2026 and the results displayed in the right side window..
    Now, click u201CCorrect erroru201D

  • Slow data speeds and AirTunes problems???

    This is a bit weird.
    Lately I've noticed that my wi-fi speeds feel very slow. Downloading files, software updates, etc., are very slow. When I plug in via an ethernet cable, everything is nice and fast.
    But here is what is also happening - I have numerous Airport Expresses around my house that are only used for music (some have wireless turned off and are connected via a cable and some have wifi turned on, but only for receiving music - none act as a wifi access point). I only have one wifi access point, and that is my Airport Extreme. All of a sudden, I can't stream music, via iTunes, from a computer connected via wifi to a computer on the wired network. But, if the computer is on wifi and the Airport Express is also on wifi, streaming works fine. Vice-versa also doesn't work (i.e. if the computer is on the wired network it cannot stream iTunes to a wifi Airport Express but it can stream to wired Expresses).
    Something is very weird, and I think it has to do with the Airport Express not functioning properly. But, I have all the latest firmware updates on it and I'm getting a green light in the utility.
    Weird - I know.
    Any ideas???
    David
    Message was edited by: dschamis

    It is very possible that you may have some form of Wi-Fi interference that has been introduced recently in the immediate area that is preventing your AirPorts from providing a good clean signal.
    I suggest you perform a simple site survey, using utilities like MacStumbler or iStumbler to determine potential areas of interference, and then, try to either eliminate or significantly reduce them where possible.

  • Date validations

    Hi,
         Any body tell me what is the function module to validate the date.
    and is there any function module to check both the dates date1 and date2. Please send me all the function modules regarding all the date validations and to check the dates. Very urgent........
    Thanks.........

    Hi anil,
    1. DATE_CONVERT_TO_FACTORYDATE - Calculates and returns factory calendar date for a date (if CorrectOption = '+'); Checks if the date is work day (if CorrectOption = '-').
    2.  DATE_GET_WEEK - Returns week in which a date lies import : YYYYMMDD; Export : YYYYNN, where NN is # of week.
    3.  DATE_COMPUTE_DAY - Returns day of week for a date Import : YYYYMMDD; Export : 1-Monday, ...
    4.  WEEK_GET_FIRST_DAY - Import week in format YYYYNN where NN is # of week.
    5.  GET_WEEK_INFO_BASED_ON_DATE - mport : YYYYMMDD; Export : YYYYNN - week # for the date, Monday and Sunday of the week.
    6.  DATE_GET_FIRST_DAY_OF_WEEK - Returns week within which a date lies
    check the below link for all the date and time function modules with description.
    http://www.geocities.com/victorav15/sapr3/abapfun.html#date
    date validation
    Re: Validation of date , Posting key and Account

  • Generic Data Source and InfoPackage Data Selection

    Hello,  I'm trying to extract data from a generic data source (composed of a view joining 4 tables) using the Data Selection Criteria in an infopackage.  Sometimes the selection criteria is ignored and more data is pulled than expected.  The number of selectable items in the generic data source has been reduced (in case this was an issue) and for a short time the infopackaged pulled the expected number of records.  Then another change was made to the generic data source and the problem returned.  In any case, the transported generic data source does not work in the target system either.  I'm not sure what is causing this to happen.  Any ideas???  BW 3.5.
    Regards,
    Sue
    Message was edited by: Sue and Enrique
            Ramesh P

    Hi,
         Some of the datasources will not have  default Infopackages for them.You can create the infopackages according to the requirement.There is no big deal for creating Infopackages.You can go ahead creating them.
    Regards
    Karthik

  • Where to put data validation & DB access in MVC designed app ?

    Hi,
    I write a stand alone app, because the user interface might required lots of changes in the future, I want to apply the MVC paradigm in the user interface design to improve maintainability.
    Where should I put the routine to perform data validation and read/write database ?
    Any advice would be greatly appreciated.
    Setya

    Like the tutorial says, you mustn't perform blocking or non-running operations in the GUI event thread.

  • Viewset - active view and data validation problem

    Hey there,
    I've a problem while using a viewset (1 col, 2 rows) and the data-validation in the wdDoBeforeAction() method.
    My application works basically like this:
    The first view is displayed with 2 mandatory input fields. Upon the evaluation result of the entered data in these fields, a corresponding second view will be displayed. The input fields in the first view are set to read only and a button named "Change" appears. This button triggers an action which fires and outbound-plug to an empty view, so that the second view disappears and resets the "read only" properties of the input fields in the first view, so that the user can enter new data.
    The problem is, that the second view contains input fields itself, which are validated in the wdDoBeforeAction() method of this view. The navigation is cancelled if an error occurs. Well, this is fine if i want to submit (pressing the button "Approve" in the second view) this data and proceed, but if i want to go back to the first view (by hitting the "Change" button), i want to discard all information entered in the second view and i dont want this data to be validated. It's quite annoying if u just want to correct the first views data but have to enter correct values for the second view in order to get through the second views checks..
    I hope that's clear enough, otherwise i will upload a screenshot to clarify.
    Thx in advance
    Regards
    Pascal

    Hi Pascal,
    although I wont prefer to do so for reasons of readability, you could use wdDoProcessbeforeAction to control your view-flow.
    Take a look at the example, I have two Buttons with two actions, one is set on "Validate", the other is not (guess which on is the validating ).
    You can get the action triggered inside the doBefore ... method and determine whether or not the checkbox is set.
    So put your code to validate the input in the i(isValidting) branch and your problems are solved.
    Keep in Mind: I would delegate the Validation from the view to the controller, handle the validation myself with custom coding and then check in the view controller if any errors occured.
    hope that helped,
    Jan
      //@@end
      public void wdDoBeforeAction(com.sap.tc.webdynpro.progmodel.api.IWDBeforeAction validation)
        //@@begin wdDoBeforeAction
           IWDAction currentAction = validation.getCurrentAction();
           if (currentAction == null) return;
           String action = currentAction.getText();
           boolean isValidating = currentAction.isValidating();
           if (isValidating) {
                wdComponentAPI.getMessageManager().reportException(action);
           } else {
                wdComponentAPI.getMessageManager().reportSuccess(action);
        //@@end
    Edited by: Jan Galinski (Holisticon) on Sep 8, 2009 3:15 PM

Maybe you are looking for