cancel
Showing results for 
Search instead for 
Did you mean: 

time conversion into words

Former Member
0 Kudos

hi friends,

I want to convert time into words .

example 17:49 i want to convert it into seventeen forty nine hrs

is there any function module . if so please revert back me

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

Just split the time into Hours and Minutes and pass those numbers to Table

T015Z, it will give the number spell for each number

then concatenate those two string of words and display

Reward points for useful Answers

Regards

Anji

Former Member
0 Kudos

Hi,

there is no Fm for you need but you can write your own fm like this.

data: mytime type t, hour(2) type c,min(2) type c, sec(2) type c.

data: word(10) type c, compword(50) type c.

mytime = '12:25:00'

hour = mytime+0(2).

min = mytime+3(2).

sec = mytime+6(2).

perform getword using hour changing word.

concatenate compword word 'hour and ' into compword.

perform getword using min changing word.

concatenate compword word 'minutes and ' into compword.

perform getword using sec changing word.

concatenate compword word ' seconds' into compword.

write: compword.

form getword using time1(2) type c changing word(10) type c.

case time1.

when '0'.

word = 'zero'.

when '1'.

word = 'one'........upto sixty.

endform.

regards,

Ashok Reddy

mohammed_moqeeth
Active Participant
0 Kudos

Hi venkat,

please find the below link for your kind reference:

/people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps

Mark reward points for all helpful answers.

Regards,

Moqeeth.

Former Member
0 Kudos

Hi Venkat,

Check this code.

data: mytime type t, hour(2) type c,min(2) type c, sec(2) type c.
data: word(10) type c, compword(50) type c.
mytime = '12:25:00'

hour = mytime+0(2).
min = mytime+3(2).
sec = mytime+6(2).

perform getword using hour changing word.
concatenate compword word 'hour and ' into compword.

perform getword using min changing word.
concatenate compword word 'minutes and ' into compword.

perform getword using sec changing word.
concatenate compword word ' seconds' into compword.

write: compword.

form getword using time1(2) type c changing word(10) type c.

case time1.

when '0'.
word = 'zero'.

when '1'.
word = 'one'........upto sixty.

endform.

Reward if useful.

Thanks

Aneesh.

Former Member
0 Kudos

answer is there.