Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function OBJV( ) error

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.

Former Member
Former Member replied

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.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question