‎2008 Mar 19 12:02 PM
Hi I need a funcion module to separate a real number in to its integer part and decimal part.
Eg. The number 3.45 should be separated as 3 and 45.
Please help me out.
‎2008 Mar 19 12:06 PM
Just write this coding ...
data : v_type type p decimals 2 value '3.45'.
data : v_type1(10),
v_1(10),
v_2(10).
v_type1 = v_type.
split v_type1 at '.' into v_1 v_2.
‎2008 Mar 19 12:03 PM
Hi,
U can get them using
ceil and frac statements
x = ceil(3.45) = 3
y = frac(3.45) =0.45
write:/ x , y.
Regards
‎2008 Mar 19 12:04 PM
Hi Abhishek,
try this
DATA : TEMP TYPE P DECIMALS 3.
I = TRUNC( TEMP ). " integer part
D = FRAC( TEMP ). " decimal part
‎2008 Mar 19 12:06 PM
Just write this coding ...
data : v_type type p decimals 2 value '3.45'.
data : v_type1(10),
v_1(10),
v_2(10).
v_type1 = v_type.
split v_type1 at '.' into v_1 v_2.
‎2008 Mar 19 12:09 PM
Hi could you please provide me a function module for the same thing. It will be really helpful.
‎2008 Mar 19 12:14 PM
‎2008 Mar 19 12:15 PM
Look at this FM :
C147_STRING_SPLIT_AT_POSITION But U need to give the
position where to split ...
‎2008 Mar 19 12:22 PM