Skip to Content
author's profile photo Former Member
Former Member

General activation error.

Hi all,

This should be very easy. But somehow, I just do not know what is not right.

I have created a function group and function module.

Please help as I always getting the same error message "Statement VALUE_A is not defined. Check your spelling".

For your information, I have defined

VALUE_A as TYPE I,

VALUE_B as TYPE I,

OPERAND as TYPE C

in Import tab. And defined RESULT as TYPE I in Export tab.

Thanks in advance.

FUNCTION Z_BC_CALCULATOR.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(VALUE_A) TYPE  I
*"     VALUE(VALUE_B) TYPE  I
*"     VALUE(OPERAND) TYPE  C
*"  EXPORTING
*"     VALUE(RESULT) TYPE  I
*"----------------------------------------------------------------------

  IF OPERAND = '+'.
    VALUE_A + VALUE_B = RESULT.
  ELSEIF OPERAND = '-'.
    VALUE_A - VALUE_B = RESULT.
  ELSEIF OPERAND = '*'.
    VALUE_A * VALUE_B = RESULT.
  ELSEIF OPERAND = '/'.
    VALUE_A / VALUE_B = RESULT.
  ENDIF.
ENDFUNCTION.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2008 at 12:49 PM

    switch your statements

    it will be result = value_a + value_b

    not value_a + value_b = result

    and so

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.