How to check date input.

In a JText, I input a date valu, when i got the value ,i want to check if it's reasonable.
but idon't know how to check a number:
for example:
i input 31/31/2004,
you know it's not reasonable.
how to check it?

Here is a function that check for a valid date:
public boolean validDate(String strDatum)
boolean dane = true;
Calendar calendarDatum = Calendar.getInstance();
int godina = 0, mesec = 0, den = 0, najgolemDen = 0;
int i;
if(strDatum.length()<10)
dane = false;
else
for(i=0;i<2;i++)
if(!Character.isDigit(strDatum.charAt(i)))
dane = false;
for(i=3;i<5;i++)
if(!Character.isDigit(strDatum.charAt(i)))
dane = false;
for(i=6;i<10;i++)
if(!Character.isDigit(strDatum.charAt(i)))
dane = false;
if(dane)
godina = Integer.parseInt(strDatum.substring(6,10));
mesec = Integer.parseInt(strDatum.substring(3,5));
den = Integer.parseInt(strDatum.substring(0,2));
if(mesec>12||mesec<1)
dane = false;
else
calendarDatum.set(godina,mesec-1,1);
najgolemDen = calendarDatum.getActualMaximum(Calendar.DAY_OF_MONTH);
if(den>najgolemDen)
dane = false;
}//if(dane)
}//else (ako dolzinata e 10)
return dane;
}

Similar Messages

  • How to check current input/output rate on router subintenterface via SNMP?

    How to check current input/output rate on router (2821, etc..) subintenterface via SNMP, like cacti monitoring system.
    I cant find OID to make this with snmpwalk.
    Or there is no way to check current load by this way? Only polling?
    P.S. Ethernet subinterface, of course.
    With great respect, S.A.

    Hi,
    Try to use:
    1.3.6.1.4.1.9.2.2.1.1.6 - InBitRate
    1.3.6.1.4.1.9.2.2.1.1.8 - OutBitRate
    1.3.6.1.4.1.9.2.2.1.1.28 - ifDescription

  • How to check data type of the field symbol at run time

    Hi,
    My code is as following:
          LOOP AT <fs> ASSIGNING <wa_covp_ext>.
            ASSIGN COMPONENT 86 OF STRUCTURE <wa_covp_ext> TO <f_zzname>.
            IF sy-subrc = 0.
              ASSIGN COMPONENT 158 OF STRUCTURE <wa_covp_ext> TO <f_pernr>.
              IF sy-subrc = 0.
                  SELECT SINGLE sname INTO <f_zzname> FROM pa0001
                                WHERE pernr = <f_pernr>
                                AND endda GE sy-datum
                                AND begda LE sy-datum.
             ENDIF.
          ENDIF.
        ENDLOOP.
    This query is giving dump when <f_zzname> is type P length 8 and decimals 2, because it tries to put PA0001-sname into it which is type C length 30. So I want to check the type of <f_zzname> before the select statement. If it is character 30, then I will write the select statement else not.
    How to check data type of the field symbol at run time? If it's not possible, then can somebody suggest a workaround? Thanks.

    check this ...
    write describe statement  ...
    field-symbols : <f_zzname> .
    data : sname like pa0001-sname,
           typ(10).
    assign sname to  <f_zzname>.
    describe  field <f_zzname> type typ.
    write : typ. <-- typ contains character type in this case ..
    U can check if typ is of character(C) if so .. write the select statement ...

  • How to check users inputs

    hi,there
    i am developing an on-line shop,at the end of checking out process , the users are supposed to submit a details form which including first name ,surname, address,email, phone no, card number etc. Can any one tell me how to check those details are valid before sending to database by using javabean or taglib.
    any information is helpful , thanks in advance.

    You have three choices:
    (1) Client-side checking using JavaScript,
    (2) Server-side checking using JavaBeans,
    (3) Both.
    You can check on the client side using JavaScript to make sure that e-mail address formats are valid, numbers are numbers, strings are the right length and format, dates are correct for the locale, etc. You might want to look at the JSTL I18N capabilities here to make sure your pages can handle different locales. This saves you a network roundtrip if something is formatted incorrectly.
    The server-side checking is different: it makes sure that the input satisfies business rules. You can check for correct format again if you wish, OR assume that the client has already taken care of this. (Depends on how paranoid you want to be.) The business rules for correctness belong on the server side, not in the client.
    I'd recommend both. They really are two different kinds of checks.
    MOD

  • How to check data in the cube

    for integration purpose, how can you go and check data in the cube and validate it against the query data ? i know we can go to corresponded infocube and right click "display data" but what's on the query is not available when i execute "display data"
    Thanks

    You can always use the similar set of Restrictions as used in RKF and get the value very close to what RKF is displaying.
    But getting the same values in CKF is a bit tough..I can suggest may be you can take few/1-2 examples and do the calculations manually and compare the query result and Infocube data.

  • How to check data in physical standby database?

    Hi!
    I'm maintaining physical standby database system. everyday, i must check tranfer and apply progress. I known, it operate very good. No archive gap is found.
    But i want to check data in physical standby database that there is consistant with primary database, there isn't? What method do I use? How to do?
    thankS

    I hope the following will help
    Verifying the Physical Standby Database
    ==========================================
    Once you create the physical standby database and set up log transport services, you may want verify that database modifications are being successfully shipped from the primary database to the standby database.
    To see the new archived redo logs that were received on the standby database, you should first identify the existing archived redo logs on the standby database, archive a few logs on the primary database, and then check the standby database again. The following steps show how to perform these tasks.
    Step 1 Identify the existing archived redo logs.
    On the standby database, query the V$ARCHIVED_LOG view to identify existing archived redo logs. For example:
    SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME
    2 FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
    SEQUENCE# FIRST_TIME NEXT_TIME
    8 11-JUL-02 17:50:45 11-JUL-02 17:50:53
    9 11-JUL-02 17:50:53 11-JUL-02 17:50:58
    10 11-JUL-02 17:50:58 11-JUL-02 17:51:03
    3 rows selected.
    Step 2 Archiving the current log.
    On the primary database, archive the current log using the following SQL statement:
    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
    Step 3 Verify that the new archived redo log was received.
    On the standby database, query the V$ARCHIVED_LOG view to verify the redo log was received:
    SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME
    2> FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
    SEQUENCE# FIRST_TIME NEXT_TIME
    8 11-JUL-02 17:50:45 11-JUL-02 17:50:53
    9 11-JUL-02 17:50:53 11-JUL-02 17:50:58
    10 11-JUL-02 17:50:58 11-JUL-02 17:51:03
    11 11-JUL-02 17:51:03 11-JUL-02 18:34:11
    4 rows selected.
    The logs are now available for log apply services to apply redo data to the standby database.
    Step 4 Verify that the new archived redo log was applied.
    On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log was applied.
    SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG
    2 ORDER BY SEQUENCE#;
    SEQUENCE# APP
    8 YES
    9 YES
    10 YES
    11 YES
    4 rows selected.

  • How to check date of purchase

    How can i check date of purchasing of iphone in this website

    If you bought it from Apple, you can view your past purchases via your store account.

  • Help,how to check a input type?

    Dear all experts,
    in the selection-screen,user need to key in the vendor consignment code ( vdrcsg  for mslb-lifnr ) some user key in storage location ( mseg-lgort ) in this field. Is there anyway tat i can do verification before procees to the start-of-selection? how to check if the user key in correct data type to the selection screen? thanks

    hi Joan,
            Check these links :
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a234d9b511d1950e0000e8353423/frameset.htm
    http://www.erpgenie.com/abap/selection_screens.htm
    http://www.sapdevelopment.co.uk/reporting/selscr/selscr_loopscreen.htm
    priyanka.

  • How to check date overlapping?

    Hi,
    What is the easiest/simplest way to check date overlapping?
    I have date_start1, date_end1, date_start2 and date_end2, and I'd like to know if they're overlapping or not.
    I searched for FM OVERLAP, but so far couldn't find one, which would help.
    I've found FM TB_TIME_INTERVAL_OVERLAP, which looked promising, however I couldn't make it work, maybe I used a wrong calculation method /I tried several/.
    Any idea?
    Thanks in advance,
    Peter

    Hi All,
    You can use the FM to validate the date overlap when from date and to date in which the date ranges have been given.
    <i>       CALL FUNCTION <b>'GM_VALIDATE_DATE_RANGE'</b>
              EXPORTING
                i_from_date              = sy-datum
                i_to_date                = c_enddt              "'99991231'
              TABLES
                t_daterange              = p_dates
              EXCEPTIONS
                ranges_overlap           = 1
                range_has_holes          = 2
                continuous_but_excessive = 3
         OTHERS                   = 4
                erro_message             = 99.
            CASE sy-subrc.
              WHEN '0'.
              WHEN '1'.
                MESSAGE e004(z_common)  DISPLAY LIKE 'E'
                        WITH 'Date range should not overlap with Existing One'(003).
              WHEN '2'.
                MESSAGE e004(z_common)  DISPLAY LIKE 'E'
                        WITH 'Date range should not overlap with Existing One'(003).
            ENDCASE.</i>
    <b>OR</b>
    Only for date ranges validation no matter whatever the date ranges are given.
    you can use the Z function module from the above one mentioned.
    <b><i>FUNCTION zgm_validate_date_range.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_FROM_DATE) TYPE  DATS OPTIONAL
    *"     REFERENCE(I_TO_DATE) TYPE  DATS OPTIONAL
    *"  TABLES
    *"      T_DATERANGE STRUCTURE  GMDATERANGE
    *"  EXCEPTIONS
    *"      RANGES_OVERLAP
    *"      RANGE_HAS_HOLES
    *"      CONTINUOUS_BUT_EXCESSIVE
      DATA: i TYPE i,
            l_next_date  LIKE sy-datum,
            l_first_date LIKE sy-datum,
            l_last_date  LIKE sy-datum,
            no_days      TYPE tfmatage,
            cnt_next     TYPE i,
            w_daterange  TYPE gmdaterange.
      DESCRIBE TABLE t_daterange LINES i.
      IF i > 1.
        SORT t_daterange BY from_date.
    First determine if the slices are continuous and have
    no gaps.
        LOOP AT t_daterange.
          cnt_next = sy-tabix + 1.
          IF sy-tabix > 1. " not first record
            IF t_daterange-from_date <= l_next_date.
              RAISE ranges_overlap.
            ENDIF.
            IF t_daterange-to_date <= l_next_date.
              RAISE range_has_holes.
            ENDIF.
          ELSE.
    save first date
            MOVE t_daterange-from_date TO l_first_date.
          ENDIF.
    update end of range
            MOVE t_daterange-to_date TO : l_last_date,
                                                            l_next_date.
        ENDLOOP.
      ENDIF.
    ENDFUNCTION.</i></b>
    Thanks
    Ramesh Babu N

  • How to check data after mapping for BPM if the mapping done outside BPM ?

    Hi.
    I have simple scenario BPM. Proxy -
    > JDBC. I have 1 message mapping in between PROXY and JDBC.
    and i have put the mapping outside the BPM (i didn' use transformation step). In case error happen. how i can see the data after the mapping ? i am always got difficulty to check the data if i have mapping outside bpm.
    Thank you
    Fernand

    Hi
    In case error happen. how i can see the data after the mapping ?
    You have used mapping in interface determination of corresponding receiver determination. In transaction SXMB_MONI, open message corresponding to that receiver determination. There in left hand side you will see IS pipeline steps. There if you want to see message payload that is input to Mapping than see payload of any pipeline step before Request Message Mapping and test it in Design. If mapping fails you can see trace of the same step.
    Request Message Mapping ---> SOAP Header ---> Trace
    There you can see where your mapping failed.
    And as rohit replied you can also get message from RWB.
    For further clarification revert back to us.
    Regards
    Sami
    Reward points if helpful.

  • How to check date globally?

    Hi,
    I wonder how I best check for a date against a fixed date.
    e.g. I want to check that zrcthau-erdat is before 01 jun 2008. 
    I wonder as I do not know how the date preference is set for the user running the program.
    it could be:
    MM/DD/YYYY
    MM-DD-YYYY
    DD.MM.YYYY
    YYYY/MM/DD
    YYYY-MM-DD
    And so on....
    I specially run into this issue in the smartforms logic 'flowlogic alternative'  I can e.g. verify the  condition 
    VKORG = '2275' but how do I do this with the zrcthau-erdat as I do not know what the date format of the user is.
    Or does smartforms handle it all in internal dates?
    Anybody any ideas?
    Thanks,
    Frans

    Hi
    The information of day can be stored in a field with the data type is DATS.
    The DATS is type N of 8 char and it has always the internal format YYYYMMDD, when the date has to be shown, the system translate the date from internal (input) to external (output) format.
    This doesn't depend on how the developer store the date in the system, i.e if developer saves the date in wrong format it's as if he saved a wrong date.
    If I have the date 11/06/2008 and when I store this date I insert 11062008 (instead of 20080611), the system will interpret a date where the year will be 1106, the month 20 and the date 08.
    Anyway u should consider in every screen of SAP the date is always automatically converted from input to output format (when it has to show a date) and output to input format (when it has to store the value).
    The developer should manage the input format only in the interface program, where the date comes from non SAP-system.
    Max

  • How to check data sent by XI in the SAP system?

    Hi All,
    I have a File to Proxy scenario. I have generated and activated the proxy. The scenario got executed successfully.
    Now, how can I check the data being sent by XI in the SAP system? Kindly help.
    Thanks,
    Karthik

    Hi,
    If u want to check in XI system as said by experts you can check in SXMB_MONI transcation(Check for chequred flag:Sucess).If not you need to see the error message and troubleshoot.
    if the message is sucess in XI,then goto your R/3 system.
    you can check SXMB_MONI in R/3 system.Tis is the message before going to proxy.
    Then as experts have already pointed out you must be knowing which tables are getting updated.
    check in those tables for the updated data.
    otherwise you need to debug proxy,
    Plz keep the thread updated.
    thanks and regards
    parvez

  • How to check data in the cube ? just for a selected request .

    hi,
    I am running 5 different DTP for a cube. and i can see 5 Succesful request ID available for reporting (In manage cube ).
    Now, how do i check recoards for a perticuler request, so that i can check , if the data is comming right or not !
    if i select the request id ( in the Request Tab ) and then switch to content tab, then i guess its showing me all the recoards , which are there in the cube by all the DTP.
    please help me out,
    thanks

    Hi,
    Check if you have Loading date Field in your info cube. you can reconcile the records based on loading date.
    SujanR

  • SQL - How to check data type definition

    Is it possible to check (inside SQL statement) how particular field is defined. Is it VARCHAR2(5) or VARCHAR2(10)

    If by field you mean column, then use USER_TAB_COLUMNS, ALL_TAB_COLUMNS or DBA_TAB_COLUMNS:
    SELECT  TABLE_NAME || '.' || COLUMN_NAME || ' ' || DATA_TYPE ||
            CASE
              WHEN DATA_TYPE LIKE '%CHAR%' THEN '(' || DATA_LENGTH || ')'
              WHEN DATA_TYPE = 'NUMBER' THEN '(' || DATA_PRECISION  || ',' || DATA_SCALE || ')'
            END X
      FROM  USER_TAB_COLUMNS
      WHERE TABLE_NAME = 'EMP'
      ORDER BY COLUMN_ID
    X
    EMP.EMPNO NUMBER(4,0)
    EMP.ENAME VARCHAR2(10)
    EMP.JOB VARCHAR2(9)
    EMP.MGR NUMBER(4,0)
    EMP.HIREDATE DATE
    EMP.SAL NUMBER(7,2)
    EMP.COMM NUMBER(7,2)
    EMP.DEPTNO NUMBER(2,0)
    8 rows selected.
    SQL>   SY.

  • How to check Data Source extraction Logic

    Hi Experts
    Please explain me in details steps how/where can i check the logic of data sources
    We have data sources based on
    1) Custom data source based on Function Module  (Where can i check the code/logic....)
    2) Standard Business Content Data source (Where can i check Logic)
    3) Standard Business Content Data source which is enhanced to inculde ZZ fields (Where can i check Logic)

    1) Custom data source based on Function Module (Where can i check the code/logic....)
    Go to tcode RSO2, enter the generic DataSource name and click Display. In the next screen, it will show you the Function Module that that's used for the extraction of data. Copy that FM name, go to tcode SE37, past the FM name that you previously copied and then click on Display. This is where you can view the extraction logic for the generic DataSource based on a Function Module.
    2) Standard Business Content Data source (Where can i check Logic)
    Follow the same for display of generic DataSource source. On the initial screen, if you get an I-type message after clicking on Display, that message displays the name of the Function Module being used, otherwise hit Enter to get to the next screen.
    3) Standard Business Content Data source which is enhanced to inculde ZZ fields (Where can i check Logic)
    Transaction CMOD is used for the creation/maintenance of User Exits. In CMOD, use the dropdown to select the custom Project that's been defined on your source SAP application for BW extraction User Exits, and select the Components radio button. Click on Display. A list of INCLUDE programs will be shown. These INCLUDE programs each represent the four types of DataSources.
    EXIT_SAPLRSAP_001 - Transaction Data DataSources User Exit
    EXIT_SAPLRSAP_002 - Master Data Attribute DataSources User Exit
    EXIT_SAPLRSAP_003 - Master Data Text DataSources User Exit
    EXIT_SAPLRSAP_004 - Master Data Hierarchy DataSources User Exit
    You will have to know the type of data (e.g. Transaction, Master Data Attribute, etc) to know which INCLUDE to go into. Once you know which one to go into, double-click on it and this will bring into display mode on that INCLUDE. Another INCLUDE will be present that begins wth Z*. Double-click on that, and you should then be in the area where the logic is for determining where to go if the DataSource has a certain value and you should be able to get to the code to read through it from there.
    You can also get to these EXIT_SAPLRSAP_NNN programs via tcode SE38.

Maybe you are looking for

  • Form with report, update field in the form = field is not updated in table

    Hi, I have a form with report. On Primary Key in the report is a link to the form. I select one row in the form by choosing the link in the report. Then I update a field in the form and press "Save". I see the success message "Action processed" and I

  • Using Time Capsule as External Drive for iTunes Music Folder in iTunes 9

    First, prior to upgrading to Snow Leopard and iTunes 9, I had my 210 GB of music on a 1TB Time Capsule which I accessed wirelessly through my Macbook Black and I set my path to the "iTunes Music (External) Folder" I created on the Time Capsule as the

  • Nokia Communication Center 2.0 Does not support Ex...

    When exporting SMS messages with Chinese text to csv file, all Chinese characters will turn to confusion symbols. My phone: E51 Singapor edition; Windows XP English, with Chinese PRC for non-unicode program. English version of PC suite, Nokia communi

  • New iTunes 6.02 AND new QuickTIme 7.04 Video Sound Problems

    Hi, I had updated my iTunes for Windows 6.01 and Quick Time 7.03 to the newest versions. The new software both yield the same issue for me. They will not play videos with sound properly. When I am on Quick Time and click to play a *.mov that I have h

  • Service Accounts in Sharepoint 2013

    Ok in SharePoint 2013, we have an intranet set up. Ok so on the central administration page, under Security, and configure service accounts, I selected Farm Account for the drop down menu at the top. We have 3 managed accounts for the intranet, which