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

personalizing user time settings

Former Member
0 Likes
715

Some users would have set their preference to 12 hrs and some to 24 hrs. We would like to present on the UI (BSP or ABAP screens) the time in a time format of the user (24 hr/12 hr). How do we achieve this? Is there an inbuilt routine or statement or complex data type which would help us achieve this?

5 REPLIES 5
Read only

0 Likes
681

Hello,

This you could achieve by calling FM HRVE_CONVERT_TIME which converts 12 hrs to 24 hrs formata

and vice versa.You could place a radio button on UI for 12 hrs and 24 hrs format and based on user option,

call this FM and pass TYPE_TIME as B - for 12 hrs to 24 hrs format and A - for 24 hrs to 12 hrs.

regards

Ikshula

Read only

0 Likes
681

Thanks Ishkula.

But is there anyway we can read the user setting than providing a radio button in the UI?

Regards,

Krittika D Patil

Read only

0 Likes
681

Hi,

Yes rather than using radio button,you could also read the user setting by

reading the table USR01 by passing the user name.Based on TIMEFM field

value you can know whether user's preference is 12 hrs or 24 hrs format.

( 0 - 24 hrs format, 1- 12 hrs format ).

Thanks and regards

Read only

Former Member
0 Likes
681

Hi,

Use SUSR_USER_DEFAULTS_GET function. Export parameter USER_DEFAULTS's field TIMEFM is what you need. Then convert if you need.

Take care,

Çağatay

Read only

Sandra_Rossi
Active Contributor
0 Likes
681

Hi,

This "new" user's time format has been accompanied by a change of WRITE statement, described in [SAP note 1091821 (ABAP WRITE statement and 12-hour time format.)|https://service.sap.com/sap/support/notes/1091821 ] (see kernel patches)

WRITE t ENVIRONMENT TIME FORMAT [TO c].

Sandra