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: 

To get the time period ie AM or PM

Former Member
0 Kudos

Hai,

sy-uzeit gives the time in hhmmss but how can i know that whether the time is AM or PM

Please help.

Neeraj

2 REPLIES 2

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try FM HRVE_CONVERT_TIME.

You need to specify

TYPE_TIME 'A'

INPUT TIME

INPUT_AM_PM 'AM' or 'PM'

-


TYPE_TIME A

INPUT_TIME 13:00:00

INPUT_AM_PM AM

Export parameters Value

OUTPUT_TIME 01:00:00

OUTPUT_AM_PM PM

Regards,

Ferry Lianto

Former Member
0 Kudos

Check the simple program :

data : data(2) type c,

hour(2) type c.

data time(8) type c.

time = sy-uzeit.

hour = time+0(2).

if hour < 12.

data = 'AM'.

elseif sy-uzeit > 12.

data = 'PM'.

endif.

write data.

Thanks

Seshu