‎2006 Feb 25 12:51 PM
Hi all,
My Requirement is to print the time ie hours and minutes in words in the Smartform. Could you all help me out to find the function module name for which i can pass the sy-uzeit and get the same in words.
Eg: 12:25:00
This should be printed as: tewelve hrs and twenty five minutes.
‎2006 Feb 25 2:50 PM
Hi sudhakar
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
kishore
‎2006 Feb 25 2:02 PM
I am not sure there is any standard FM avaiable to full fill your requirement. THe best way to write custom FM by refer to "SPELL_AMOUNT" FM.
‎2006 Feb 25 2:50 PM
Hi sudhakar
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
kishore
‎2006 Feb 28 6:15 AM
Hi Hari,
Thanks a lot for the solution and I have created a function module and its working fine.
And I have not forgotten you to reward you ther points. Thanks a lot.
‎2006 Feb 26 4:17 AM
‎2006 Feb 26 4:31 AM
Hi Sudhakar,
I dont see any Function Module for this.You need to write a code for this,which seems to be laborious.