2012 Sep 17 8:10 AM
Hi,
i am using the decimal value with data type and length is : dec 6,
i want to round this value, if .5 above then add +1 integer
i check the ROUND keyword and function module also it is showing the same input value as output
can any one give me suggestion
Hi,
i am using the decimal value with data type and length is : dec 6,
i want to round this value, if .5 above then add +1 integer
i check the ROUND keyword and function module also it is showing the same input value as output
can any one give me suggestion
2012 Sep 17 8:17 AM
Hi,
Use the FM J_1I6_ROUND_TO_NEAREST_AMT
Pass the value to Amount field.
Regards
Ram
2012 Sep 17 8:20 AM
my field is decimal value, can i use this FM, i hope this is related to amount field
2012 Sep 17 8:27 AM
Any How u want if ur value is .5 it had to become 1...
So declare a variable of type J_1ITAXVAR-J_1ITAXAM1
And pass the Value to this Variable..
and pass this variable to the FM... thats it.
Regards
Ram
2012 Sep 17 9:18 AM
Hi,
You can use round function itself.
Dont test it at SE37.
Your variable should be of data type F , P or I even dec is accepted.
Test the below sample code
DATA: test TYPE p VALUE '0.5'.
CALL FUNCTION 'ROUND'
EXPORTING
decimals = 0
input = test
sign = '-'
IMPORTING
output = test
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.
WRITE:/ test.
If my understanding was wrong. Please clarify.
Regards,
Akhil
2012 Oct 08 10:52 AM
Hi ,
is there any data type only for numaric values, it wont allow the character values ex : mobile number , here it must accept only digits but not characters
for this i use numc data type but when i gave numbers it is showing error
can u plz suggest me is there any data type for that
2012 Oct 08 10:52 AM
Hi ,
is there any data type only for numaric values, it wont allow the character values ex : mobile number , here it must accept only digits but not characters
for this i use numc data type but when i gave numbers it is showing error
can u plz suggest me is there any data type for that
2012 Oct 10 8:54 AM
Hi,
Yes the input values can only be of the type floating point , packed or integer.
It wont work for other types like character.
You can use packed number (P).
This will work for your requirement i guess.
Regards,
Akhil
2012 Oct 10 9:38 AM
Have a look into statements like FRAC, CEIL, FLOOR. It can be done with these functions.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |