on 09-01-2008 11:01 AM
Hi,
I try to call a FM from integrated planning. I get the following error message:
Formula error: Type 0COSTELMNT is not allowed for the function
Syntax error in row 7, column 13
DATA COSTELMNT TYPE 0COSTELMNT.
DATA RATE TYPE F.
DATA AMOUNT TYPE KEYFIGURE_NAME.
FOREACH COSTELMNT, AMOUNT .
COSTELMNT = OBJV( ).
CALL FUNCTION Z_PLANNING_CALC_VALUES
EXPORTING
CALYEAR
AMOUNT
IMPORTING
E_RATE = RATE.
Objv() function is used for the characteristic that is not selected as fields to be changed. Your code reads the value of the costelement from variable COSTELMNT in the foreach statement and also from objv() . I think you should remove the line COSTELMNT = OBJV( ) in order to run the code with no syntax errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check if costelement is in fields to be changed.. If not, keep it in that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If only one cost element is coming into fox code, use the OBJV statement before foreach and remove costelement from foreach.
Else
If multiple costelements are there, when you give costelement in foreach, no need to use objv() again. The value of costelement comes in the variable used in foreach automatically.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.