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: 

date format

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use write statement

write ur_datum to req_date.

red date should be of type c char 10.

11 REPLIES 11

Former Member
0 Kudos

use write statement

write ur_datum to req_date.

red date should be of type c char 10.

Former Member
0 Kudos

Hi Sonia,

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

regards

satesh

Former Member
0 Kudos

go sytem->userprofile->owndata

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

Former Member
0 Kudos

i want the date to be printed in the report.

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

former_member188685
Active Contributor
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

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

d2(10).

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

Kindly reward points if it helps.

Former Member
0 Kudos

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.