Skip to Content
avatar image
Former Member

date format in application

hi im working on webdynpro abap. In the application i have to put date in format DD.MM.YYYY but i want functionality in which when i enter it other format it shouldnt update the data and report error .In my case it is taking date 19.10.20 as 19.10 2020 .im not able understand why such thing is happening

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 02, 2008 at 06:52 AM

    Hi,

    check your user settings, that's next to the time format settings, see the [documentation|http://help.sap.com/saphelp_nw70/helpdata/en/46/f7bb3bde4369b5e10000000a114a6b/content.htm]

    Regards, Heidi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 09:36 AM

    Hi,

    First read the date and then string manipulate to get your desired format.

    Here you have taken the length of date filed as 8 and you are trying to give it in '.' separated format.

    Please have a look at sample code to get a clearer picture.

    data : lv_year(4) type c,

    lv_day(2) type c,

    lv_month(2) type c.

    data lv_changed_date_new(10) type c.

    data lv_changed_date like ls_changedby-changed_date.

    navigate from <CONTEXT> to <CHANGEDBY> via lead selection

    lo_nd_changedby = wd_context->get_child_node( name = wd_this->wdctx_changedby ).

    get element via lead selection

    lo_el_changedby = lo_nd_changedby->get_element( ).

    get single attribute

    lo_el_changedby->get_attribute(

    exporting

    name = `CHANGED_DATE`

    importing

    value = lv_changed_date ).

    lv_year = lv_changed_date+0(4).

    lv_month = lv_changed_date+4(2).

    lv_day = lv_changed_date_6(2).

    concatenate lv_day lv_month lv_year into lv_changed_date_new separated by '.'.

    lv_changed_date_dats with contain date in format dd.mm.yyyy

    Regards,

    Prosenjit.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 06:22 AM

    pls tell me code for same

    Add comment
    10|10000 characters needed characters exceeded