Skip to Content
avatar image
Former Member

date format dd/MMM/yyyy still a bug?

Dear all,

Is the dd/MMM/yyyy format for a simple type (built-in type date) still a bug in webdynpro?

Issue: When you create a simpletype in the webdynpro dictionary, of type date with format dd/MMM/yyyy it doesnt appear as such in the views.

When i create a simple type, built-in type timestamp, with the same format, it does show as 17/Nov/2009, but the datepicker is missing then.

Should i create a SAP message for it? I assume they want to fix this, since they claim to support the formated supported by SimpleDateFormat.

Kind regards,

J

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 17, 2009 at 11:16 PM

    Hi Joren,

    Are are correct about date picker being a bug in NWDS right not. Date of the format DD/MMM/YYYY would only be supported by simple type when the screen loads for the very first time. Later on modification, the date format wont be changed as per what is defined in the simple type. So, you can raise a request for the same to SAP. In the meantime what you can follow is use DateNavigator UI element in Popup Window which opens on click of a button next to date inputfield. Let this date input field be bound to an attribute of the type string. Using the SimpleDateFormat API convert the entered string to corresponding date in case if valid or to current date if invalid and point the same when user clicks on the button placed next to input field. In the same way convert the date to string of required format on close of the popup window when the date from DateNavigator is selected.

    Regards,

    Tushar Sinha

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I tried your solution, but this doesn't make a difference.

      According to the SAP note i mentionned, the format for date inputfields is not taken from the format in the simple type anymore. So i wonder what the new approach for this is...

      Hope someone has tried it in the 7.11 version.

      Kind regards,

      J.

  • Nov 17, 2009 at 11:49 AM

    Hi

    Format the date object in required format

    Try this code

    String str_date = "11-June-07";
    		DateFormat formatter;
    		Date date;
    	    java.sql.Timestamp timeStampDate = null ;
    		formatter = new SimpleDateFormat("dd-MM-yyyy");
    		try
    		{
    			date = (Date) formatter.parse(str_date);
    			timeStampDate = new Timestamp(date.getTime());
    			wdComponentAPI.getMessageManager().reportSuccess("Today is " + timeStampDate);
    		}
    		catch (ParseException e)
    		{
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		wdContext.currentContextElement().setDateYtp(timeStampDate);

    Best Regards

    Satish Kumar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2010 at 11:04 AM

    Closed.

    Raised an OSS message @ service.sap.com

    Add comment
    10|10000 characters needed characters exceeded