Date Field in Webdynpro

Hi there,
I have a attribute that is Date and have binded it with an UI field in webdynpro.
However, the format of date input in ABAP is yyyymmdd but the one used by webdynpro is something like 01/01/09. Is there a way I can change the format of the date being captured in the field to suit the format of ABAP date input?
Pls advise me!

Hi 
  I think you cant do the format of Abap in front end as showing .but you can pass the data to backend data Format as  "yyyyMMdd"  you can not shows apab format at front end side ..but its automaticaly render original format as per Web dynpro fundamental but you can save front format to abab fromat at time of data store in back end System"  as Format  string  "yyyyMMdd..using some piese of code....
                                String inputDate="1/2/2009";
          SimpleDateFormat sdfinput = new SimpleDateFormat("dd/MM/yyyy");
          java.util.Date output = null;
          try {
            output = sdfinput.parse(inputDate);
              } catch (ParseException e){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
                      String in=sdf.format(output);
Hope you will get the answar

Similar Messages

  • Date field in Webdynpro Java

    Hi, I am trying to hardcode date field in a project with date say "21.11.2007", the rfc takes only date in java.sql form. can you please help me how can I do so. Plz help me out.
    Regards
    Umang

    I have used the following code for importing the date value to a rfc the I have checked that the code for date is fine but still I am not getting any output. I think that its the issue of the date format. Because while testing the RFC, it is not accepting date in   dd-mm-yyyy format but is only accepting in the format dd.mm.yyyy or ddmmyyyy.
    So I believe that it is the issue of date format. or might be possible that there would be some error in the way I am executing the RFC.
    Even after setting the debugger in RFC, the the RFC is not coming into picture i.e, the project is not hitting the RFC  might be because of the wrong format of date .
    Could you please refer to the code and suggest something.
    Rp_Get_Pernr_From_Userid is the name of RFC.
         try
                Rp_Get_Pernr_From_Userid_Input inp = new Rp_Get_Pernr_From_Userid_Input();
                wdContext.nodeRp_Get_Pernr_From_Userid_Input().bind(inp);     
    wdContext.currentRp_Get_Pernr_From_Userid_InputElement().setBegda(new java.sql.Date((new java.util.Date()).getTime()));
    wdContext.currentRp_Get_Pernr_From_Userid_InputElement().setUsrid(wdContext.currentContextElement().getUserid());
    String dateInput = "9999.12.31";
           SimpleDateFormat sdf = new SimpleDateFormat( "yyyy.MM.dd" ) ;
                java.sql.Date dt = null;
                try {
                    dt = new java.sql.Date( sdf.parse(dateInput).getTime()) ;
                catch(Exception io)
                 io.printStackTrace();
              wdContext.currentRp_Get_Pernr_From_Userid_InputElement().setEndda(dt);
    wdContext.currentRp_Get_Pernr_From_Userid_InputElement().modelObject().execute();
    catch (Exception e)
                                             wdContext.currentContextElement().setTest(e.toString());

  • Error with date field when inserting records into sql server from webdynpro

    Dear SDN's,
    I am trying to insert the records into sql server through my webDynpro program.
    I have created a date field in a dictionary with the datatype date.
    In my webdynpro program to insert the date i am following the below format.
    String dateString = "2006/12/10";
          java.util.Date d=new java.util.Date(dateString);
          java.sql.Date <b>date</b> = new java.sql.Date(d.getTime());
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,<b>REQDT</b>,ADVCE,ETADV,PURTR) values(21, '555-1212', '" + <b>date</b> + "', 5000, '20060501','hi')");
    when i try to execute it, it gives the following error.
    <b>com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "TRAVEL_HEADER" ("TRQID","PROJECTID","REQDT","ADVCE","ETADV","PURTR") VALUES (21,'555-1212','2006-12-10',5000,'20060501','hi')" contains the semantics error[s]: - type check error: new value (element number 3 (CHAR)) is not assignable to column  >>REQDT<< (DATE)</b>
    Please correct me.
    Your help will be appreciated.
    Regards,
    Sireesha.B

    Hi,
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,REQDT,ADVCE,ETADV,PURTR) values(21, '555-1212', 'date', 5000, '20060501','hi')");
    try like this.
    I Think in SQL the general format to take date as input like this.
    INSERT INTO X VALUES ('10/30/56')
    thaks,
    Lohi.

  • 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

  • F4 help for Time field in Webdynpro Screen

    Hi Experts,
    I'm using TIMS data type for my Time field. In ECC we will have F4 function for the same data element, but in Webdynpro screen, am not getting the F4 help.
    I got some information from SCN that I need to go for some custom search help. But with which reference to the table, am I want to create it.
    Please let me know, is there any other possible way to create F4 for time field for webdynpro.
    Even I tried to use some standard search help, but am getting an error as 'Sending of dynpro ' ' not possible. No window system type specified'.
    Expecting valuable information from you experts.
    With Regards,
    RAM.

    Hi RAM,
    For time field, there is no SAP delivered search help in WDA , so we need to go for freely programmed search help.
    Please refer the below link, in which Mr. Thomas, has provided the links for search help document you can follow and create new search help component
    and also nugget of the component which can be imported using ZSAPLINK program.
    search help for time
    Regards,
    Rama

  • Date field in Web Dynpro ABAP

    Hi All,
    I want to implement the Input Date Field on my WebdynPro Application in the same way as it is availble at "SCN - Contribution Points / filter criteria" .
    I want to give the user the option to change the year , past or future easily.
    I have tried to call that date UI Element , but unable to do so.
    Please help me which UI Element to use as am new in WebDynPro ABAP...
    Thanks and Regards
    Hemachandran

    hello,
    One way of doing is  -  declare two attributes(DATE_LOW and DATE HIGH ) in the context node of type DATS.Place two input feilds in the view INPUT1 and INPUT2 , bind the two attributes to the two input feilds.
    The other way is use  OVS ( object value selector ) Search Help.
    Regards,
    Naga

  • Need to change Date field Zone from IST to UST

    Guys,
    I have to develop a application in which there is a Date field. This date is coming from Application Server i.e. R3 and is in India, terefore it's IST. Now when this application is run from US, it should give the UST.
    Means Actually I want to change the Date from IST to UST.
    Can somebody please reply with the coding that needs to be done.
    Thanks,
    Nikesh Shah

    Hi,
    Refer the following link
    Date format
    Java Webdynpro Date Format
    I hope it helps.
    Regards,
    Rohit

  • Date setting in webdynpro

    hello
    i have a from date and to date field
    i have to set the to date as (current date) default
    and the from date to (current date - 7 days) default
    how do i code for this in webdynpro java.

    Hi Rohan
    java.util.Date monday = DateHelper.getMondayDateOfCurrentWeek();
    // it will get the monday of the current week
    java.util.Date sunday = DateHelper.addDays(monday, 6);
    //it will get the sunday of the current week (in this context Monday is firstday and sunday is the last day)
    Date fromDate = new Date(monday.getTime());
    Date toDate = new Date(sunday.getTime());
    wdContext.currentContextElement().setFromDate(fromDate);
    //Sets the monday to your input field (Date Picker)
    wdContext.currentContextElement().setToDate(toDate);
    //Sets the sunday to your input field (Date Picker)
    create a java project and add this code to that project
    code for getMondayDateofCurrentWeek and addDays is as follows..please refer to this and make changes accordingly
    actually this is a java file .which i included in my project . DateHelper is my class name.you also do the same and .class file to your webdynpro project
    static public Date getMondayDateOfCurrentWeek() {
              Date today = new Date();
              Date monDate = today;
              int day = getDayOfWeek(today);
              //2 because 2 is Monday
              if (day > 2)
              while (day > 2)
                   monDate = yesterday(monDate);
                   day = getDayOfWeek(monDate);
              else
              while (day < 2)
                   monDate = tomorrow(monDate);
                   day = getDayOfWeek(monDate);
              return monDate;
    static public final Date addDays(Date target, int days)
              // returns a Date that is the sum of the target Date
              // and the specified number of days;
              // to subtract days from the target Date, the days
              // argument should be negative
              long msPerDay = 1000 * 60 * 60 * 24;
              long msTarget = target.getTime();
              long msSum = msTarget + (msPerDay * days);
              Date result = new Date();
              result.setTime(msSum);
              return result;
    For More reference <a href="https://forums.sdn.sap.com/click.jspa?searchID=6993015&messageID=4032225">Look this thread</a>
    Best Regards
    Chaitanya.A

  • Data fields in dso

    Hi
    If I need to calculate amount based on source and destination,and if these two source and destination fields char are there in data fields of dso and keyfigure amount is also in data fields of DSO can we get exact value if make report on this.
    thx
    rubane

    Actually i need to build report where in rows there will be some char
    like source plant and destination plant and in rows on the basis of source and destination the cummulated value of amount base on some other few restriction
    now my question is :-
    acc to my need I need to make genric extractor but one is already there which contains all my fields. now can i use the same extractor,but the worry is ;these all feilds are first going in dso and all are there in data fields coloumn
    What I'm thinking is; it will suppress or accumulte records on the basis of key field's(as usual).
    so can you pls let me know what to do in this scenario?
    how to build a new report using existing extractor ;can i use existing one?
    rubane

  • DSO - What key fields and data fields in dso

    Hi experts,
    I need to create a dso in between the cube and 2 data sources(2lis_11_vaitm, 2lis_12_vcscl) to stage the data. My question is: what key fields and data fields to choose for the dso? is there a standard dso to copy? please explain in detail the model to set up, whether to connect both the ds's to dso and then to cube or one ds to dso and the other to the cube. more details will help.

    Check this for standard DSO:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/fcdc387f34384f94c3227baf3837a8/content.htm
    Thanks...
    Shambhu

  • Key Fields & Data Fields in DSO.

    In Standard DSO, Maximum how many number of key fields and data fields we can enter in one DSO?
    For e.g : In Cube Char - 248      KF - 233
                  In DSO Key Fields - ?   Data Fields - ?
    Regrards,
    Nithi.

    Hi Nithi,
    Since Key fields are decide by us we can add according to our requirement.
    Key fields can only be 16 you cannot exceed this. but if you have more key fields, you can combine fields using a routine for a key field
    Max Data Fields - 749 data fields can be added in a DSO.
    Warm regards
    Gokul

  • Error While using date fields in HIbernate Criteraia

    I am trying a sample applciation using Hibernate with JPA. I am using annotations to map database table with Java class.I am using org.hibernate.Criteria to form where clause. My code looks as follows:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("PERSISTANCE_UNIT");
    EntityManger em = emf.createEntityManager();
    Session session = em.getDelegate();
    Criteria criteria = session.createCriteria(MyDO.class)
    criteria.add(Restrictions.eq("myDO.date",myDO.getDate()));
    List list = criteria.list();
    I am searching the data base based on the date field (myDO is an instance of MyDO.class which contains the mapping to the data base table). While running the application first time after publishing to server, I am getting the following error. For subsequent running of the application I am not getting any error and the appliaction was running with actual results.
    JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: -181, SQLState: 22007
    JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE
    org.hibernate.exception.DataException: could not execute query
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.loader.Loader.doList(Loader.java:2223)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
         at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    Can anybody help in fixing the problem.
    Thanks in advance.

    Resolved the issue by setting System date where expected

  • SAP R/3 Tables without Date fields

    I am trying to import data from SAP R/3 into MS SQL DWH.
    There are tables which doesnot have posting date fields.
    Can anyone tell me how to map them with those Table which will have posting date fields, so i can create view in SAP and then pull that view into SQL DWH restricting on date.
    Following tables which doesnot have date fields i want to pull date for month of July 2007;
    EKBE
    EKKO
    MAKT
    MSEG
    KSEG
    AFPO
    JEST
    JCDS
    MARA
    AUFK
    COEP
    RESB
    MARC
    I am not a ABAP developer just trying to get my data from SAP, so please answer in detail.

    BUDAT is the technical name for Posting Date field. This field is used many DB Tables/ Strucutres. Using where used option you can find the required tables.
    I suggest you to look at BSEG table for Finace Document postings by Posting Date.

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • DTP can Not extract data of date field from PSA to Target DSO

    Hi everyone.
    I enhanced several fields in datasource "2LIS_12_VCITM". that is date field "BLDAT" and another date type fields.
    The data of date type fields are extracted very well from datasource to PSA.
    But only field "BLDAT" among them are NOT extracted from PSA to target DSO.
    Another date type fields is good. but only "BLDAT" field is empty.
    I added "BLDAT" later than another date fields.
    Is that the reason??
    I don't know why.
    Let me know the solution. pls~~~~

    Hi,
    Try deleting and recreating the DTP and loading again.
    This solution refers to note 925941 and should be solved in SPS10.
    Best regards,
    Olav

Maybe you are looking for