cancel
Showing results for 
Search instead for 
Did you mean: 

date format in application

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

pls tell me code for same