2008 Jul 01 8:06 AM
Hi,
i am using a dec field(6,2)
I need to round of this field,how to do this..I am in 4.6c version..
Can any one give a sample
Ids there any function module
2008 Jul 01 8:09 AM
Hi,
How do you want the O/P to be??? give an example plz
you can use the write statemnt addition : decimals and round
or use the FM ROUND
regards
prasanth
Hi,
How do you want the O/P to be??? give an example plz
you can use the write statemnt addition : decimals and round
or use the FM ROUND
regards
prasanth
2008 Jul 01 8:09 AM
Hi,
How do you want the O/P to be??? give an example plz
you can use the write statemnt addition : decimals and round
or use the FM ROUND
regards
prasanth
2008 Jul 01 8:10 AM
hi,
use arthimetic operations
CEIL
Smallest integer value that is not less than x
FLOOR
Largest integer value that is not greater than x
TRUNC
Interger part of x
FRAC
Decimal part of x .
2008 Jul 01 8:10 AM
2008 Jul 01 8:17 AM
Use
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 0
INPUT = P_QUOTA_ROUND
SIGN = '-'
IMPORTING
OUTPUT = P_QUOTA_ROUND
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Amit.
2008 Jul 01 8:18 AM
Hi
Please do it like this way
DATA : v_data TYPE p LENGTH 6 DECIMALS 2,
l_str TYPE string,
l_str1 TYPE string,
l_str2 TYPE string.
v_data = '333.53' .
l_str = v_data.
SPLIT l_str at '.' INTO l_str1 l_str2.
if l_str2 >= '50'.
l_str1 = l_str1 + 1.
ENDIF.
move l_str1 to v_data.
WRITE : / v_data.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |