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

date format

Former Member
0 Likes
1,229

How do we handle system date format is mm/dd/yyyy but the enduser format is dd.mm.yyyy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,128

use write statement

write ur_datum to req_date.

red date should be of type c char 10.

11 REPLIES 11
Read only

Former Member
0 Likes
1,129

use write statement

write ur_datum to req_date.

red date should be of type c char 10.

Read only

Former Member
0 Likes
1,128

Hi Sonia,

Do you want the date to be printed in dd.mm.yyyy format in the report...

regards

satesh

Read only

Former Member
0 Likes
1,128

go sytem->userprofile->owndata

go to defaults there and change the format to what ever required

Read only

Former Member
0 Likes
1,128

i want the date to be printed in the report.

Read only

0 Likes
1,128

Hi,

Use the WRITE stmt. It will convert it to the user format and print!

make sure u consider all possible system formats when handling date field. Ideally u shd use a FM to convert!

-Aarthi.

Read only

0 Likes
1,128

a few clarifications!

-When U/I said 'system format', I assume it is ur system format and not the internal date format! as sum1 jus said internal date format is always yyyymmdd!!

-When I said account for all poss formats -> make sure ur code handles dot separated, '/' separated format and also the various sequence like mm/dd/yyyy, dd/mm/yyyy etc.

Read only

Former Member
0 Likes
1,128

Hi,

Use any of the foll. FM

HRGPBS_HESA_DATE_FORMAT

Format a date valid for HESA: DD/MM/YYYY

HRGPBS_TPS_DATE_FORMAT

Format a date valid for TPS: DDMMYY

SLS_MISC_GET_USER_DATE_FORMAT

get the date format the user has defined as his/her default

Hope it solves..

Thanks

Eswar

========================================

Hey..Here is the complete code

REPORT ZES .

data: v_date type char10.

CALL FUNCTION 'HRGPBS_HESA_DATE_FORMAT'

EXPORTING

p_date = sy-datum

IMPORTING

DATESTRING = v_date.

replace all occurences of '/' in v_date with '.' .

write v_date.

Message was edited by: Eswar Kanakanti

Read only

Former Member
0 Likes
1,128

Hi sonia,

1. system date format is mm/dd/yyyy

The systems date format is always YYYYMMDD.

2. but the enduser format is dd.mm.yyyy.

Well, that can be changed from user profile :

SYSTEM --- > USER PROFILE ---> OWN DATA

3. In that there is DEFAULTS tab.

In that, select the format.

regards,

amit m.

Read only

Former Member
0 Likes
1,128

Hi Sonia,

As amit said ask your user to change his profile, ask him to run SU3 and maintain his own format of date.

its a small thing. which ever format he likes ask him to choose from the available formats...

Regards

vijay

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,128

Hi,

data : d1(10) value '12/31/2006',

d2(10).

concatenate d13(2) '.' d10(2) '.' d1+6(4).

Kindly reward points if it helps.

Read only

Former Member
0 Likes
1,128

if its in an internal table output

u can use write:/ date1 to date2 using edit mask

'__'/'__'/'____' this can be filled as mm/dd/yyyy or dd/mm/yyyy .

if ur looking for the system settings then got tansaction SU01 and giv the user and in the change mode

go to defaults subscreen and adjust the date format to ur desired format.

regards,

vijay.