2006 Sep 01 12:56 PM
Hi all
i want to take the values before the .
Is there any F.M?
I declared a variable like currency
Eg: Value is 22,000.74
My output will be 22,000
2006 Sep 01 12:57 PM
check this example...
DATA: I TYPE I,
P TYPE P DECIMALS 2,
M TYPE F VALUE '-3.5',
D TYPE P DECIMALS 1.
P = ABS( M ). " 3,5
I = P. " 4 - business rounding
I = M. " -4
I = CEIL( P ). " 4 - next largest whole number
I = CEIL( M ). " -3
I = FLOOR( P ). " 3 - next smallest whole number
I = FLOOR( M ). " -4
I = TRUNC( P ). " 3 - integer part
I = TRUNC( M ). " -3
D = FRAC( P ). " 0.5 - decimal part
D = FRAC( M ). " -0.5
2006 Sep 01 12:57 PM
check this example...
DATA: I TYPE I,
P TYPE P DECIMALS 2,
M TYPE F VALUE '-3.5',
D TYPE P DECIMALS 1.
P = ABS( M ). " 3,5
I = P. " 4 - business rounding
I = M. " -4
I = CEIL( P ). " 4 - next largest whole number
I = CEIL( M ). " -3
I = FLOOR( P ). " 3 - next smallest whole number
I = FLOOR( M ). " -4
I = TRUNC( P ). " 3 - integer part
I = TRUNC( M ). " -3
D = FRAC( P ). " 0.5 - decimal part
D = FRAC( M ). " -0.5
2006 Sep 01 12:58 PM
2006 Sep 01 12:58 PM
Hai Priya,
You can use string+offset(length) to get the required result
2006 Sep 01 12:59 PM
2006 Sep 01 12:59 PM
2006 Sep 01 1:05 PM
Define a variable that have no Decimals places. Ex:
data : sample type p ."decimals 0.
move '15256.256' to sample.
"sample has value 15256
if you want to use character type. u can
data : index type i.
data : sample type c value '15,256.256'.
data : begin of splitter occurs 0,
word(20),
end of splitter.
split sample at '.' into table splitter.
describe table splitter lines index.
clear sample.
loop at splitter from 1 to index.
concatenate sample splitter-word into sample.
endloop.
condense sample no-gaps.
ibrahim
2006 Sep 01 1:20 PM