Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

General activation error.

Former Member
0 Likes
593

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
559

switch your statements

it will be result = value_a + value_b

not value_a + value_b = result

and so

Thanks MxG.

I am so blur today. Thanks for your kind help.

2 REPLIES 2
Read only

Former Member
0 Likes
560

switch your statements

it will be result = value_a + value_b

not value_a + value_b = result

and so

Read only

0 Likes
559

Thanks MxG.

I am so blur today. Thanks for your kind help.