Application Development 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: 

How to change system date format from YYYYMMDD to DDMMYYYY.

Former Member
0 Kudos

Hi,

I Iwant to convert system date format from YYYYMMDD to DDMMYYYY.

I need a function module to do that.

I have used Function Module to change the format to DD.MM.YYYY

But i want to remove dots from that format.

Please give an example for the same..

Regards,

Ash

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

data:v_date like sy-datum,

v_date1(10) type c.

Concatenate v_date6(2) v_date4(2) date+0(4) into vdate1.

RESULT = V_DATE1

Reward If useful

Regards

Ravi

Edited by: Ravikanth Alapati on Mar 28, 2008 9:00 AM

12 REPLIES 12

Former Member
0 Kudos

concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into variable.

use this variable as output.

Former Member
0 Kudos

Hi,

data:v_date like sy-datum,

v_date1(10) type c.

Concatenate v_date6(2) v_date4(2) date+0(4) into vdate1.

RESULT = V_DATE1

Reward If useful

Regards

Ravi

Edited by: Ravikanth Alapati on Mar 28, 2008 9:00 AM

0 Kudos

Thank you, this works very well.

Former Member
0 Kudos

hi,

do this way ..


date : v_final(10),
          v_sdate like sy-datum value sy-datum,
          v_date(10).
v_date = v_sdate.
cocatenate v_date+6(2)  v_date+4(2) v_date+0(2) into v_final.
 

Regards,

Santosh

Former Member
0 Kudos

go to sap easy access initial screen.

goto menu

systems-> userprofike-> owndata--->

click default tab. there u can change format

0 Kudos

Hi kumar,

Thanks for the solution to change the system date and time format.

Former Member
0 Kudos

hi asha ,

suppose,from the function module form which you are getting the date in a field var_date.

Just use this code :

Replace all occurences of '.' with space in var_date.

condense var_date with no-gaps.

Or you can use this code also

concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into var_date.

SantoshKallem
Active Contributor
0 Kudos

HRGPBS_TPS_DATE_FORMAT

Regards.

santhosh reddy

Former Member
0 Kudos

hi use this....

parameters:p_date type sy-datum.

data: data1(4) ,

data2(2),

data3(2),

data(8).

data1 = p_date+0(4).

data2 = p_date+4(2).

data3 = p_date+6(2).

concatenate data3 data2 data1 into data.

write:/ data.

regards,

venkat.

Former Member
0 Kudos

Hi Asha,

Try using the below code


DATA : date TYPE sy-datum,
            result(10) TYPE c.

CONCATENATE date+6(2)  date+4(2) date+0(2) into result.

WRITE : result.

Regards,

Chandru

SumanaSoori
Participant
0 Kudos

HI,

How did you changed the date format from YYYYMMDD to DD.MM.YYYY.

What is theFM you have used?

Regards

s_nnoorie
Active Participant
0 Kudos

Hi,

you can change the data format in many ways.

1. change in user profile Systems -> userprofile --> own data in tab defaults.

2. by concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into sy-datum

3. by using edit mask command

DATA : date1 TYPE char8,

date2 TYPE char10,

date1 = sy-datum.

WRITE date1 USING EDIT MASK '__/__/____' TO date2.

or

WRITE date1 USING EDIT MASK '__.__.____' TO date2.

or

WRITE date1 USING EDIT MASK '__-__-____' TO date2.

or

WRITE date1 USING EDIT MASK '__ __ ____' TO date2.

4. using function module : HRGPBS_HESA_DATE_FORMAT