Skip to Content

Problem with Date Format in a Table.

Hi, I have several views, in each views I have two tables with two fields of date.

This data are from an adaptive RFC function exported in Date ABAP format.

The webdynpro is showing me the date in mm/dd/yyyy format, and I want to change that to dd/mm/yyyy. Which is the easiest way to accomplish this.

Thx

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Nov 04, 2006 at 04:58 AM

    Hi,

    You can use the simpledate format, have a look at this ,

    http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

    Regards,

    Saravanan K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 04, 2006 at 05:51 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 04, 2006 at 07:14 AM

    Hi,

    Try this.,

    1. Get the attributeinfo of ur DateAttribute in model node.

    2. Make it modifiable simple type.

    3. setFormat to ur required format.

    Eg Code:

    IWDAttributeInfo dateinfo = wdContext.getNodeInfo().getChild("Bapi_Node_Input").getAttribute("dateAtt");

    ISimpleTypeModifiable dateSimpType = dateinfo.getModifiableSimpleType();

    dateSimpType.setFormat("dd/MM/yyyy");

    Do the same for other date attribute also.,

    Regards,

    Aparna .P

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 04, 2006 at 09:34 AM

    Rodrigo,

    Before you start to alter default behavior, take on acount that it was created with certain reason, namely support for internationalization(I18N) and localization (I10N). So WD application displays date, times, currencies in locale-specific manner.

    Altering just date display leads to inconsistences with other formatting.

    The locale is choosen by sevearl criterias, you may search WD forum to find out more. Briefly, WD consider settings in UME for logged-in user, browser headers and application url parameters.

    For example, try to add the following sap-locale parameter with settings for Spanish/Argentina:

    sap-locale=es_AR

    <b>Notice, that unlike other options suggested here, this will affect all formating in your application. Moreover, if back-end is localized as well (R/3 for example) you will get localized data from back-end</b>

    Valery Silaev

    SaM Solutions

    http://www.sam-solutions.net

    Add comment
    10|10000 characters needed characters exceeded

    • I found the solution, and I feel somehow stupid :P

      I didnt know that the locale region settings is based on the computer where the SAP development studio is and the deploy is made.

      I tought that was taken on the machine that run the webdynpro.

      So I changed the setting on the remote server were my SAP dev studio is to my regional setting and worked fine.

      Thx to all.