‎2007 Jun 19 8:17 AM
Hello Friends,
I have a value of form HH:MM:SS and I have to parse it as follows:
I have to take HH saprate and multiple it with 60 and then add in MM ?
Do we have somthing in ABAP that I can split this HH:MM:SS ?
What do you guys suggest, should I make the type of HH:MM:SS as numc or string ?
Regards,
‎2007 Jun 19 8:28 AM
Hi Shah,
Make the value as string and using split command you can do it.
parameters: time type string.
Data: min(4) type n,
hour(2) type n,
seconds(2) type n.
Split time at ':' into: hour min seconds.
min = min + hour * 60.
Regards,
Chander
‎2007 Jun 19 8:20 AM
Hi SHAH,
take it as string and use the command SPLIT string
data: zs_string type string,
zs_1(2) type c,
zs_2(2) type c,
zs_3(2) type c.
zs_string = 'HH:MM:SS'
split zs_string at ':' into zs_1 zs_string.
split zs_string at ':' into zs_2 zs_string.
zs_3 = ( zs_1 * 60 ) + zs_2.
Message was edited by:
mukesh kumar
‎2007 Jun 19 8:22 AM
Hi mukesh ,
Can I then multiple the string with 60 ?
How it will works ?
Regards,
‎2007 Jun 19 8:24 AM
convert to string and use the split statement at ':'. Now convert each value to int and multiply.
‎2007 Jun 19 8:25 AM
hi shah,
yes there is an abap command which split the varialbe...
use the following command...
split time at ' : ' into HH, MM, SS.
after this,
HH = will be having some value...from above
MM =
SS =
hope this will help u out...
please reward points in case usefull...
regards,
prashant
‎2007 Jun 19 8:28 AM
Hi Shah,
Make the value as string and using split command you can do it.
parameters: time type string.
Data: min(4) type n,
hour(2) type n,
seconds(2) type n.
Split time at ':' into: hour min seconds.
min = min + hour * 60.
Regards,
Chander
‎2007 Jun 19 8:39 AM