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

Change the time format

Former Member
0 Likes
551

Hi all,

In my internal table I have a time field which is 24 hour format.But I have to display in hh:mm (am/pm) format.

Can anyone guide me how to do that.

Thanks,

Uga.

Hi all,

In my internal table I have a time field which is 24 hour format.But I have to display in hh:mm (am/pm) format.

Can anyone guide me how to do that.

Thanks,

Uga.

3 REPLIES 3
Read only

Former Member
0 Likes
521

Hi,

use <b>SET TIME MASK = 'HH: MM'</b>

Regards

Nilesh

Read only

Former Member
0 Likes
521

loop at itab and pass the time value to FM HRVE_CONVERT_TIME

1. 14:00:00 = 02:00 PM

2. use this FM

HRVE_CONVERT_TIME

3. In the parameter TYPE_TIME, give 'A'.

Read only

Former Member
0 Likes
521

hii,

take the 24 hour format date into a variable seperate the hours and minutes and put them into some other variables.

now substract 12 from hour.

check if the number is > 0 or not. if yes then write the number as positive with PM

if the number is < 0 then write the number as it is with AM

concatinate minutes with the hour and merge them in 1 variable.

please reward points if useful.

thanks,

vikaas