Validating a Date field in ADF which only contains a time

Hi,
I'm having problems in JDeveloper 10121 validating a "time" field in a jsp.
* I have this field: <html:text property="InterviewTime" size="4" maxlength="4" />
which is a date. I want the user to enter a date in 24 hour format. I.e. 0000 to 2400.
* In my view object the interview time has a format of Simple Date (kkmm).
* In the entity object this is a date column.
If I submit with a valid date then it's fine. However if for example I enter 3333 and save I get a date parse error. The problem is where do I handle this?
I added validation to the entity object but this only gets called when the date is valid (I imagine it is further on in the lifecycle?)
I also added some regex to the onCommit method but again this gets called later in the lifecycle.
Can anybody help?
Thanks,
Andy

Frank,
I can't use ADF Faces as I'm using 1012.
I have a method validation on the entity object as shown below:
public boolean validateInterviewTime()
Date interviewTime = getInterviewTime();
if ( interviewTime != null )
LOG.info("Testing");
SimpleDateFormat sd = new SimpleDateFormat("kkmm");
String interviewTimeString = sd.format( getInterviewTime().getValue() );
LOG.info("interviewTimeString"+interviewTimeString);
if ( !Pattern.matches( "((0?[0-9]|1[0-9]|2[0-3])[0-5][0-9])", interviewTimeString ) )
LOG.info("BAD");
return false;
else
return true;
However if the interview time is outside the range anyway (i.e. not between 0000 and 2359) then it will not even get as far as validating it as I get an invalid date exception called?
So I need to catch it somewhere else.

Similar Messages

  • Table for Valid To date field in C203 Tcode

    Let me know the table name for "Valid To Date" field in C203 transaction.
    Thanks,
    Angavai.E

    Hi Angavai,
    Check with table PLMW.
    Regards,
    Raghu

  • Business partner change Valid From Date field

    How can I change the Valid From Date field in tables:
    BUT000
    BUT020
    BUT0BK
    BUT100
    Currently the of date of creation of the business partner is in this tables' Valid From field.
    In transaction BP the Address of the Business Partner is  valid from 01.01.1990 but still I get a warning that the business partner is not valid for date 01.11.2011.

    Sounds like the problem is the valid to date.  What is that date set to?

  • How can I read an input which only contain the 26 upper case letter

    Are there any method that can read an input which only contain 1 character and it is in upper case too.
    should I use readChar( ), or readString( )??
    How should I implement them if I do use one of them?
    thx

    Try this :
    import java.io.*;
    public class Read
    public static void main(String[] x)
    System.out.println("Upper case char typed : "+readUpperCaseChar());
    public static char readUpperCaseChar()
    // method that read char and return the last upper case char
    char x='\0',tmp='\0';
    try
    while(tmp!='\n')
    tmp=(char) System.in.read();
    if(tmp >= 'A' && tmp <= 'Z')
    x=tmp;
    catch(IOException ioex)
    ioex.printStackTrace();
    return x;

  • Validation of data fields in the Excel through webdynpro java

    Hi all,
         I have requirement as below:
                  There are data fields in the Excel File which are mandatory.When we are uploading the Excel file through webdynpro java it should validate the  mandatory data fields are filled or not.Can anybody please send the required code or any related links.
    Thanks,
    Prakash.

    Hi Surya,
    As per my info, you need to upload the file first then only web dynpro will be able to check for the mandatory fields.
    Do this, while reading the buffer from the excel, just check the size of desired columns. Hope that will help.
    Best Regards
    Chander Kararia

  • Validation on Date Field in tabular Report

    Hi All,
    I have manually created the Tabular report and in that I have TWO DATE field
    1)Start Date
    2)End Date
    Now i want to put validation on start date as - Start Date Should Be More than sysdate.
    and validation on End date as - End Date should be More taht Start Date.
    How to put the validation ?

    Manish Jha wrote:
    What is the error you are getting ? Try executing the process in SQL workshop with hard coded values of apex_application.g_f03 and debug the error.
    Thanks,
    Manish
    >What is the error you are getting ? Try executing the process in SQL workshop with hard coded values of apex_application.g_f03 and debug the error.
    Thanks,
    Manish
    Hi manish ,
    I have Used the following code to validate end date should be more less than start date;
    DECLARE
    l_error VARCHAR2 (4000);
    BEGIN
    IF TO_DATE(apex_application.g_f05 (i), 'DD-MON-YYYY ') > TO_DATE (apex_application.g_f04 (i),'DD-MON-YYYY'
    THEN
    l_error :=l_error
    || '</br>'
    || 'Row '
    || i
    ||' ,TEST';
    END IF;
    END LOOP;
    RETURN LTRIM (l_error, '</br>');
    END;
    it's giving the error like :
    ORA-06550: line 16, column 6: PLS-00103: Encountered the symbol "RETURN" when expecting one of the following: begin function pragma procedure The symbol "begin was inserted before "RETURN" to continue. ORA-06550: line 16, column 24: PLS-00103: Encountered the symbol "BEGIN"
    Error ERR-1024 Unable to run "function body returning text" validation.
    What to change in the code?
    Edited by: N.K on Jun 23, 2009 11:43 PM

  • View criteria with date field in ADF

    Hi ADF Experts,
    I have a requirement like.I have a VO with query let say  "Select * from Employee"
    I have created viewCriteria in that VO like "HireDate between 'abc' and 'XYZ'.
    In AMImpl class I have written, one fuction to apply viewcriteria on VO and execute query.
    Expose that function as service method, and execution form backing bean.
    It is working properly for all other column except the date field.(May be beause of date format, as we cannot apply To_Char, or ToDate in view criterai for date format)
    Tried all possible combination but no luck
    Please help

    Hi,
    The below link might be helpful for you
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/59-table-filter-by-data-range-176653.pdf
    Thanks
    Prabhat

  • Error in validation of Date Field

    Hi Experts,
    For my date field i assigned validation and is working properly.I could pop up the error message also.But my issue is, the entered wrong data is not getting deleted or cleared from the date field after validation.
    How i can clear the wrong data entered in field automatically?
    Please help me.
    Regards,
    Arun.

    Hello Arun,
    Can we use validate event for the same? Ideally it should cancel teh submit of the form.
    I am a using SAP Adobe Interactive forms using transaction SFP in ABAP Workbench and am trying to check the possible ways to apply validations (client side validations) to the form data. These forms are expected to get called from HCM Processes and Forms processes.
    Regards
    Rajeev

  • Data validation for Date Field in Web Dynpro ABAP

    Hi ,
    In my WDA i want to perform data validation for date filed. (i.e. While creating a new record i have to check the Start Date should be always lesser than End Date.)
    If u ll enter the wrong date it should validate the Date and throw an error message.
    Please Reply soon its urgent.
    Thanks,
    Deepika

    Hi,
    First read the two attributes start date and end date.
    Then write the following condition.
    IF item_start_date > item_end_date.
    Error message.
    Endif.
    For pop up error message you need to use Create_window method of the Interface if_wd_window.
    Thanks.

  • "valid from" date field in TCURR

    Hi All,
    I was looking out the Valid from field in TCURR table but couldn't figure out the format of the way the dates are stored in SAP for this field. Here is how they looked:
    Valid from
    80039898
    80039898
    80039898
    79929778
    I tried to change the format in excel after downloading the table but that didn't help much.
    All answers will be duly rewarded with points.
    Thanks,
    N

    Hi Nandita,
    Dear Nandita,
    The dates are just stored as "inverted dates"
    This is even implemented as pure ABAP statements:
    CONVERT date to inverted date ... and
    CONVERT inverted date to date.
    See the documentation on these keywords. It is just the 9er complement of the real date, example from your question ( 80039898):
    99999999
    -19960101
    80039898 => value for GDATU.
    Please assign points if it useful.
    Regards
    Ravinagh Boni

  • Dummy query which only contains text

    Dear experts,
    I wanna create a dummy query which is only used to display some texts.
    Because I wanna use these text in my workbook, you know if I input some texts in my workbook manually, so there will be some issue during the translation.So I wanna get these text from a dummy query instead of typing some fixed texts manually.
    But now the problem I met is that if the Infoprovider which is behind the dummy contains no data, the dummy query will not be displayed, only No data available displayed.
    Is there any way to force the dummy query display even the behind Infoprovider contains no data?
    Thanks in advance!
    Best regards
    Fanchest

    Frank,
    I can't use ADF Faces as I'm using 1012.
    I have a method validation on the entity object as shown below:
    public boolean validateInterviewTime()
    Date interviewTime = getInterviewTime();
    if ( interviewTime != null )
    LOG.info("Testing");
    SimpleDateFormat sd = new SimpleDateFormat("kkmm");
    String interviewTimeString = sd.format( getInterviewTime().getValue() );
    LOG.info("interviewTimeString"+interviewTimeString);
    if ( !Pattern.matches( "((0?[0-9]|1[0-9]|2[0-3])[0-5][0-9])", interviewTimeString ) )
    LOG.info("BAD");
    return false;
    else
    return true;
    However if the interview time is outside the range anyway (i.e. not between 0000 and 2359) then it will not even get as far as validating it as I get an invalid date exception called?
    So I need to catch it somewhere else.

  • Type "CURR - Currency field, stored as DEC" only contains 2 decimal digits?

    We have a KF which has a data type of "CURR - Currency field, stored as DEC" mapped to a R3 field with 3 decimal digits, but "CURR - Currency field, stored as DEC" data type in BW/BI takes up only 2 decimal digits that the last digit of R3 field value is ignored.
    Any idea for a workaround?
    Thanks!

    Go to RSA1 - and go to the key figure info object and change the properties.
    Ravi Thothadri

  • Date Field validation in APEX 4.0

    Hi,
    I am using APEX 4.0 for developing my application. I have an SEARCH region in which I have an DATE item with format MM/DD/YYYY. When I enter the date with any junk characters like 'XXXXXXX' then it throws me an validation as "Invalid Date Format" message both in Notification and Inline (Below date Item). This is an APEX 4.0 inbuilt validation for date field and its not the validation created by me in that page explicitly.
    My Issue is that I do not want to Display the validation message inline to the field and I need the message only in Notification. What setting I need to do in Date Item to remove the inline validation message form that field.
    Thanks in Advance

    Hi,
    In your validation process, under the error message section
    (i.e) in the error message display location: set inline in notification give this,
    so that the notification will be fired only in message, not inline to the field.
    Regards,
    Mini
    Mark Answers Promptly

  • Changes to Rebate Agreement Validity Date Field

    Hi,
    We are trying to prevent people from changing the "Validity To" date field (KONA-DATBI) on Rebate Agreement masters (VBO3). They are back dating the field which is causing probelms for running billings.
    Is they any way this can be done via a validation on that field or a message that pops up when the field is changed to something earlier than current date?
    Thanks

    Hi,
    This fields is opened for a good reason, sometimes the end-date of an agreement should be reduced when you want to split a period and therefore create a new agreement for the remaining period.
    In my opinion this is a procedure problem, your users must know what they do.
    If someone still keeps on introducing incorrect data in the system, this person should receive additional training and / or be warned.
    To answer your specific question:
    There is no user-exit for the rebate agreement master data. Quite a shame.
    Best Regards,
    Franck

  • How to set a date range for date field ?

    Dear Experts,
    Scenario:
    I have a query in validating the date field in my BSP application. My application is for maintain infotype 0023 Other/Previous Employers online by employees in the company.
    As per our design we are maintaining the all employment details of the employee both ( with in the current company / previous employment outside the company) in the same infotype.
    Every employee will have a hiring date within the SAP HR system. We consider this date as the cutoff date between current and previous employment in our application. When the employee updating the details wia BSP page I need to check the following.
    Record inside current company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  greater than or equal HIRING DATE and END DATE(ENDDA) should be greater than FROM  DATE (BEGDA).
    Record outside current Company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  less than or equal HIRING DATE and END DATE (ENDDA) should be greater than FROM  DATE (BEGDA) and less than HIRING DATE.
    Technical Requirement:
    How to set a date range for date field, i.e. how we can limit the date range in a HTMLB date field? Can this it be achieved via standard functionality of HTMLB?
    Following is the code to describe date field in my application.
        <htmlb:inputField id= "ENDDA_NEW_IN"
                          type= "date"
                    doValidate= "TRUE"
                      showHelp= "TRUE"
                      disabled= "FALSE"
                         width= "183"
                         style= "cssTextAreadate"
                         value= "<%='99991231'%>"/>
    Thanks a lot in advance for your assistance and help.
    Cibinu2026
    Edited by: cibin kuruvilla on Nov 12, 2008 11:13 AM

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

Maybe you are looking for