‎2007 Sep 21 12:56 PM
Hey,
I know this is a stupid simple question, but how can I obtaint the decimals from a number of type P (let's say 1023.45). I want to have in a variable that 45 value.
Thanks,
Andrew
‎2007 Sep 21 12:58 PM
Hi
declare 2 variables
put the number into a string
then use SPLIT command at decimal and separate the decimals and integer portion.
Regards
Anji
‎2007 Sep 21 12:58 PM
Hi
declare 2 variables
put the number into a string
then use SPLIT command at decimal and separate the decimals and integer portion.
Regards
Anji
‎2007 Sep 21 1:00 PM
‎2007 Sep 21 1:00 PM
DATA : TEMP TYPE P DECIMALS 3.
I = TRUNC( TEMP ). " integer part
D = FRAC( TEMP ). "
In variable I, u will get integer part and in D fractional part.
‎2007 Sep 21 1:02 PM
data : l_num type p decimals 2,
l_pre type i,
l_post type i.
l_num = 1023.45.
SPLIT l_num at '.' into l_pre l_post.
‎2007 Sep 21 1:14 PM
USE THIS.<b>PROBLEM RESOLVED</b>
REPORT ZTESTU1 .
data : A TYPE I.
DATA : B TYPE VBAP-KWMENG.
DATA : C TYPE VBAP-KWMENG.
B = '1000.23499'.
A = B.
C = B MOD A.
WRITE:/ C.
REGARDS
AMIT SINGLA