Getting Date in the form in JSP

Hi,
I am working on a form created in JSP that gets the date from the user, just in case the user wants to modify the date (default is current date), i wish to provide an option for that. Is there any other way apart from using list boxes asking for day,month and year?
My doubt is about the part - alternate for listboxes with separate options for day, month and year.
Thanks and Regards,
Reshma
Message was edited by:
ReshmaCB

Other way is to let the user manually enter the date in desired format, e.g. yyyy-MM-dd, and use SimpleDateFormat to convert between String and Date.
Date date = new Date(); // Today's date.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateString = sdf.format(date); // 2007-05-24And the reversed way:String dateString = "2007-05-24";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(dateString); // Thu May 24 00:00:00 [zone] 2007Check the SimpleDateFormat API for several date format patterns.

Similar Messages

  • How can get difference between 2 dates in the form of days

    how can get difference between 2 dates in the form of days

    Hi,
    Check the following program:
    REPORT ZDATEDIFF.
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Regards,
    Bhaskar

  • Pre-populating Server's Current Date in the form- How to??

    The simplest way of doing this is writing one-line formcalc script.
    This is not fair when the user changes his local system date/time.
    I need to know how to pre-populate the server date in the form?
    One way of doing this is writing a web service.
    Any other simple solution to do this??
    Thanks,
    Nith

    If you are using LiveCycle Forms (7.x, ES, or ES2), with .pdf rendering on the server or the client, you can execute the script server side. Otherwise you have no other option but to access an external resource (REST, Web Service, JSP/servlet, etcetera) for the time, if you need to accurately capture form open time on the desktop.
    Steve

  • Hold data in the form

    Hello,
    i have a form( start.jsp) in which i can enter data about a person. The form data is bound to a person class which is saved in db. After submitting the form i inform the user ( in another page) that the submitting were successfull. But after coming back to the start.jsp to create a new person i still have the old person information data in the form. How can I have a form without my previous data.
    My bean has to be in session scope and not in request scope.
    thanks

    Reinstantiate the Form DTO.
    public void submitForm() {
        myForm = new MyForm(); // Clears the form.
    }

  • Powerpivot Error on Refresh -- "We couldn't get data from the data model..."

    I'm using Excel 2013 and Windows 8.1.  I have a spreadsheet I've been using for over a year, and I've just started getting this error message when I try to refresh the data.
    "We couldn't get data from the Data Model.  Here's the error message we got:
    The 'attributeRelationship' with 'AttributeID' - 'PuttDistCat9' doesn't exist in the collection"
    Any idea how I can fix this problem?  I haven't changed anything related to that particular attribute.  All the data is contained in separate sheets in the workbook, so there are no external sources of data.
    Thanks.
    Jean

    Thanks for all the suggestions.
    I found a slightly older version of the spreadsheet that still refreshes properly, so I don't think I have any issues with the version of Excel or Power Query.  (I've had this same error before, and I believe I applied the hotfix at that time.)
    I think this problem started after I updated a number of the date filters in the pivot tables.  I haven't made any changes to the data model, and the only updates I've made were to add data (which I do all the time), and to change the date filters on
    the pivot tables.
    As suggested, I added a new pivot table querying one table (the table with the attribute that shows up in the error message), and it worked fine.  I can also refresh this pivot table.
    Then I tried adding a pivot table which went against several tables in the data model (including the table in question).  The pivot table seemed to return that data properly.  However, when I tried to refresh it, I got the same error message ("we
    couldn't get data from the data model..."). 
    Dany also suggested running the queries one at a time to see which one is in error.  Without checking all the pivot tables, it appears that any which use the table "HolePlayedStrokes" generate the error (this is the table with the attribute
    mentioned in the error message).  Pivot Tables without that particular table seem to refresh OK.  Unfortunately, that is the main table in my data model, so most of the pivot tables use it.
    Any other suggestions?  I'd be happy to send a copy of the spreadsheet.
    Thanks for all the help.
    Jean

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • Error while saving the data in the form

    Hi,
    In forms 6i,after enteringthe data in the form,after pressing the save button it's giving error
    An Error Prevented your changes from being commited
    Anyone can help me out in this
    Regards,
    RR

    Hi to all,
    I have finished the form,now its saving.
    Actually i ahce examined a form of same in other instance,in that form the data block which is using API in its trigger is first but the form which was not saving was second to other data block
    When i changed the datablock order and compiled,now its saving the form.
    Thanks for your support
    Regards,
    RR

  • EJB-Archive for getting Data from the DB

    Hello,
    I want to get data from the Database. I created a EJB-Project with an Entity Bean and a Session Bean.
    The jar-Archive that I generated is corrupt. Is that normal?
    Can you provide me with information on database acces?
    In ABAP it would be a piece of cake: Select * from table into ...;-)
    Greetings, Frank

    Hi Frank,
    I see that you are interested in getting data from R/3, please correct me if I'm wrong.
    If that's so, you cannot do it by purely using EJBs, as an entity bean maps to a Table row in the database, which is not quite straight forward in terms of R/3.
    The only way to get data from R/3 is to use
    1)Java + SAP JCO
    2)or a Netweaver technology like Webdynpro + Adaptive RFC
    3)Portal Component + SAP JCO.
    Again, assuming you're dealing with a WebAS server, coming to EJBs, its no different to any other application server. So, you need an RDBMS to use Entity Beans.
    Please let me know if you've got more doubts.
    Regards,
    Rajit

  • How to print the data on the form (smartform)...

    Hi,
    i got a requirement that i have to create a selection screen and from that i process the data according to the inputs in the selection screen, and after i collect the entire data in an internal table, now i want that data to be displayed in the form ,
    what is the process for this, can anybody explain me in detail.
    Regards,
    Ram

    Hi!
    To create new smartform
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Or an another one:
    just check it step by step with lots of screen shots.
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Reward all helpfull answers
    Regards
    Tamá

  • How to execute the data in the form when the data is already avaliable

    Hi,
    I am working with forms 6i. I have a problem while executing the data in the form
    Actually, the data is already present in the form. But when i run the form, the data is not displayed.
    can anyone please help me how to execute the data. below is the code
    Set_Alert_Property(alert_id,ALERT_MESSAGE_TEXT,'Do you want to refresh new Data for that Year and Field ? (it will take a time).') ;
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON1, LABEL, 'Yes');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON2, LABEL, 'No');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON3, LABEL, 'Cancel');
                   button_number :=Show_Alert(alert_id) ;
                   synchronize;
                   if button_number != ALERT_BUTTON3 then
                        if button_number = ALERT_BUTTON1 then
                             :param.field := :control.f_cd;
                             :param.year := :control.year;
                             build_tables;
                             fields;
    -- areas(:param.field);
                             PUT_PARAM;
                             COMMIT_FORM;
                        go_block('wet_criterias');
                        end if;
                        if button_number = ALERT_BUTTON2 then
                             :exhibits.field_display := :control.f_name || ' - Exhibits';
                             go_block('RESERVOIR');
                             execute_query;
                        end if;
                   end if;
              end if;
    else
         message('Fields must be entered...');
    end if;
    else
    message('Fields must be entered...');
    end if;

    It's hard to know what logic you are trying to implement.
    However, by looking at your code, it seems that if the user select 'Yes' to the question "Do you want to refresh", nothing is done except the go_block('wet_criterias'). Should there be an 'Execute_Query' ?
    No idea...

  • Problem printing date on the form

    Hello friends ,
    I am doing form for the HR . Is there any special formatting needed to print the date on the form . I am doing this .
    &t_payment-paydate& in the main window of the form .
    t_payment is the table and paydate the date of payment . But instead of printing 1/22/2006 . It is printing 3//20/07/2 some junk value . Is it the format related problem ?
    Any suggestions . You help would be greatly appreciated .
    Regards & Thanks ,
    Hari

    HI,
    You can do like this.
    You make the following changes in the program
    1. Define a character type field
         data: v_payment_date(10) type c.
    2.  Assign the date value to the character field
          write t_payment-paydate to v_payment_date.
    You make the following changes in your sapscript text element.
        instead of using field t_payment-paydate use v_payment_date.
    Thanks
    Ramakrishna

  • SOAP XML Response in the form of JSP

    Hi,
    I am using a command in Websphere Commerce(WC) as "WebServices Provider " .For new users command is WC specific java program which takes input and throws back the result to the calling program.
    when a client sends a SOAP xml request to WC WebService Command,it sends back the SOAP XML response in the form of JSP to client.The Client is in Microsoft .Net language.
    My Question is:
    1)How the client is interpreting the SOAP XML response in JSP.
    2)Since the client being a .Net provider,to understand this response,he has to make any extra
    configuration ???
    Can somebody in the forum can help me in this regard.
    Thanks
    Mike

    Hi Mike1999 ,
    I am assigned with one project that is based on SOAP,I dont know abc of this technology.How the events are handled by SOAP....Etc Etc....
    Just eloberate What is ment by SOAP.Why it is used.

  • How to get data on the next page in case of templates if data is more ?

    please tell me how to get data on the next page while i m using template in my first page , if data is more howw it can be displayed on the next page ?

    HI Asim,
    template is fixed we  it can't be expand . u can better to use table line it can automaticlly expending if data is more ... u can create one more page like page 2 and create a window for entire second page ..then assign it in first page (next page page2).
    regards
    kiran kumar.

  • Ways to get data from the internet with XCode and Objective-C

    Hey guys,
    Thanks in advance for any help. I was simple wondering what the best ways are to get data from the internet to use in an application. For example, is it best to store the data in a MySQL database with PHP and then use C code and MySQL commands to get that data from my Mac app? Is JSON better? Any help would be awesome!
    Josh

    What kind of data are you after?
    Eric

  • How to get  data with the raw pattern from resultset ?

    would you tell me how to get data with the raw pattern from resultset ?
    thank you in advance!
    longgger2000

    I tried getBytes() and getObject()
    , but I can not get the right result , for example the
    data in oracle database is 01000000DFFF, when In used
    the method of getBytes() and getObject(), I get the
    result of [B@1c2e8a4, very different , please tell me
    why !
    thank you
    longgger2000
    [B is byte arrayseem that it return an bytes array for you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • I have made several iMovies.  Can the DVD be converted or Burned to view on regular tv?

    I have made several iMovies of family.  Can these DVD's be converted or Burned so that they can be viewed on regular tv?

  • JSP beginner's question

    I have a standalong application using Swing. Im converting it to a web / JSP/Servlets application. Can my JSP acess my database using the same classes it used to or should I configure in my Tomcat a data source and call my database using the jndi nam

  • Third party apps won't run

    I've had my iPhone for a couple months. Last weekend I upgraded to os 3.0. Today I had to restart my phone. Since then, no 3rd party apps will run. They start, then immediately quit. Native apps work fine. Any suggestions?

  • Agent is not Ready

    Hi All, I developed a wokflow in which i'm assigning an agents which was created in PPOCE. when the workflow is executed it is giving a message in workflow log "No Agent is ready". How to resolve this error. Rgds Faisal

  • 2 letters from AT&T with different activation instructions

    After I purchased from AT&T Premier site on June 15, I received an email confirming order received with instructions to activate after I get the phone. Those instructions were to activate on-line with an order and activation numbers on www.wireless.a