Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

changing date format

Former Member
0 Likes
1,184

how will i change the date format from MM/DD/YYYY to DD.MM.YYYY in a ALV list.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,146

You can spcify the format you want in the EDIT_MASK of the field catalog for that field.

Regards,

Ravi

Note - Please mark all the helpful answers

9 REPLIES 9
Read only

Former Member
0 Likes
1,147

You can spcify the format you want in the EDIT_MASK of the field catalog for that field.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

amit_khare
Active Contributor
0 Likes
1,146

Hi,

As an alternative you may use following code -

TYPES: BEGIN OF type_t_date,

mm(2) TYPE c,

filler1(1) TYPE c,

dd(2) TYPE c,

filler2(1) TYPE c,

yyyy(4) TYPE c,

END OF type_t_date.

DATA: t_ddate TYPE type_t_date.

CONSTANTS: c_fil TYPE c VALUE '.'.

t_ddate-mm = rs_sdate-mm.

t_ddate-dd = rs_sdate-dd.

t_ddate-yyyy = rs_sdate-yyyy.

t_ddate-filler1 = c_fil.

t_ddate-filler2 = c_fil.

CONCATENATE t_ddate-mm t_ddate-filler1 t_ddate-dd t_ddate-filler2 t_ddate-yyyy INTO rv_ddate.

Regards,

Amit

Read only

Former Member
0 Likes
1,146

Hi

Use EDIT_MASK.

Regards

Surya.

Read only

Former Member
0 Likes
1,146

To convert from YYYYMMDD to DD.MM.YYYY use the

FM<b> CONVERSION_EXIT_PDATE_OUTPUT</b>

Regards,

Santosh

Read only

Former Member
0 Likes
1,146

hi,

in field catalog u have edit_mask that should work.

santhosh

Read only

Former Member
0 Likes
1,146

write var 1 to var2 DD/MM/YYYY ,where var2 is of type c of length 10.

Perform the above and then pass the variable(Var2) instead of Var1 to the internal table which you pass to the FM or method for displaying the ALV list.

Regards

Mohamed Mansoor

Read only

Former Member
0 Likes
1,146

use offsets to do this

supposet the variable is w_var

then

w_var + 12/31/9999

concatenate w_var3(2) '.' w_var(2) '.' w_var6(4) into w_var1.

Your var1 will have 31.12.9999

Pass var1 to your ALV list.

I think this is what you need.

Reward if you find it helpful.

Prince menon

Read only

Former Member
0 Likes
1,146

use this

write SY-DATUM to variablename MM.DD.YYYY

u can change to any format dd.mm.yyyy,

dont forget to declare the variable as c, length 10.

I THINK IT WILL HELP U

Message was edited by:

Bharanidaran S

Message was edited by:

Bharanidaran S

Read only

Former Member
0 Likes
1,146

Hi

use edit-mask to get the required date format.

Regards

Haritha.