‎2010 Oct 07 11:21 AM
Hi guys,
When i was working on DMEE, i came across a scenario, where i needed to write to write a code like this,
o_value = round( fpayhx-ubnky/940 + 1 ).
but when i compile this, i got an error saying:
*The syntax for a method specification is "objref->method" or *
*"class=>method". "class=>method". "class=>method". "class=>method". *
Does anyone know wat am i supposed to do with this
thanks,
trishnau
‎2010 Oct 07 11:43 AM
Hello,
I understand that you're using DMEE Exit Module to code the logic.
o_value = round( fpayhx-ubnky/940 + 1 ).Anyway i don't think there is any in-built ABAP function defined as 'ROUND'. You can use use the Function Module 'ROUND' to do the rounding of the values.
BR,
Suhas
‎2010 Oct 07 11:43 AM
Hello,
I understand that you're using DMEE Exit Module to code the logic.
o_value = round( fpayhx-ubnky/940 + 1 ).Anyway i don't think there is any in-built ABAP function defined as 'ROUND'. You can use use the Function Module 'ROUND' to do the rounding of the values.
BR,
Suhas
‎2010 Oct 07 12:11 PM
I used the function module "round" as following...
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 0
INPUT = fpayhx-ubnky/940+1
SIGN = ' '
IMPORTING
OUTPUT =
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
.
but it gives me an error again,
The data object "FPAYHX" has no component called "UBNKY/940", but there
is a component called "UBNKY".
Since I am a beginner in ABAP, i need your guidance!
Thanks in advance.
Trishna
‎2010 Oct 07 12:21 PM
‎2010 Oct 07 1:00 PM
Hi,
You cannot call a function module with an expression.
In this case, you have to compute the result of : fpayhx-ubnky / 940 + 1 in a variable.
Note : notice the spaces between the '/' and the operands
Best regards,
Guillaume
‎2010 Oct 07 1:00 PM
Hello,
You can't pass a formula directly to a FM interface. You need to take it in a variable & pass to 'ROUND'.
BR,
Suhas
‎2010 Oct 07 1:53 PM
Hi ,
Wat u can do is tat, u hav to declare a varable and store the rsult of the calculation there. Then pass that variable as the input to ur function module.
Eg:
Data: Value type f.
value = ( fpayhx-ubnky / 940 ) + 1 ).
call function ........
exporting
input = value
importing
output = result
let me know if it help u