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

Function Module

Former Member
0 Likes
801

Hi,

when i a creating the function module

I am getting the following error. Statement "EX_RESULT=IM_NUM1+IM_NUM2" is not defined. Check your spelling

FUNCTION ZAC_CALCULATE.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IM_NUM1) TYPE I

*" REFERENCE(IM_NUM2) TYPE I

*" REFERENCE(IM_OPER) TYPE C

*" EXPORTING

*" REFERENCE(EX_RESULT) TYPE I

*"----


CASE IM_OPER.

WHEN '+'.

EX_RESULT=IM_NUM1+IM_NUM2.

WHEN '-'

EX_RESULT=IM_NUM1-IM_NUM2.

WHEN '*'

EX_RESULT=IM_NUM1*IM_NUM2.

ENDCASE.

ENDFUNCTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
781

Hi,

Now i am getting this error.

when I am checking for syntax error iam getting this error. This is the program that is present in function group. when i tried to activate that also I got the error that Report/program statement is missing.

Program SAPLZAC_GRP 2

REPORT/PROGRAM statement missing, or program type is I (INCLUDE).

10 REPLIES 10
Read only

Former Member
0 Likes
781

Hi,

Give Spaces

EX_RESULT = IM_NUM1 + IM_NUM2.

Reward if useful!

Read only

Former Member
0 Likes
781

Hi rams,

Had You Active the Function Group?

Thanks.

Read only

Former Member
0 Likes
781

Hi,

Give like this,

FUNCTION ZAC_CALCULATE.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IM_NUM1) TYPE I

*" REFERENCE(IM_NUM2) TYPE I

*" REFERENCE(IM_OPER) TYPE C

*" EXPORTING

*" REFERENCE(EX_RESULT) TYPE I

*"----


CASE IM_OPER.

WHEN '+'.

<b>EX_RESULT=IM_NUM1 + IM_NUM2.</b>

WHEN '-'

<b>EX_RESULT=IM_NUM1 - IM_NUM2.</b>

WHEN '*'

<b>EX_RESULT=IM_NUM1 * IM_NUM2.</b>

ENDCASE.

ENDFUNCTION.

Regards,

PAdmam.

Read only

Former Member
0 Likes
781

Hi,

Separate variables and operators with space.

Read only

Former Member
0 Likes
781

hi,

give the space for =.

EX_RESULT =I M_NUM1+IM_NUM2.

Read only

Former Member
0 Likes
781

Hi

Check the for the syntax errors

Like spaces on both side of the symbols = or - or *.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
782

Hi,

Now i am getting this error.

when I am checking for syntax error iam getting this error. This is the program that is present in function group. when i tried to activate that also I got the error that Report/program statement is missing.

Program SAPLZAC_GRP 2

REPORT/PROGRAM statement missing, or program type is I (INCLUDE).

Read only

0 Likes
781

Hi Rams,

Go to SE80 and Select The Function Group name.

Then enter your Function Group name and right click it, and select the activate the Function Group.

It will solve your problem.

Thanks.

Read only

0 Likes
781

Hi,

Your program must be containing some Include programs which are inactive.

Activate them separately & then activate the entire program.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
781

Hi,

Try this code.

FUNCTION ZAC_CALCULATE.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IM_NUM1) TYPE I

*" REFERENCE(IM_NUM2) TYPE I

*" REFERENCE(IM_OPER) TYPE C

*" EXPORTING

*" REFERENCE(EX_RESULT) TYPE I

*"----


CASE IM_OPER.

WHEN '+'.

EX_RESULT = IM_NUM1 + IM_NUM2.

WHEN '-'

EX_RESULT = IM_NUM1 - IM_NUM2.

WHEN '*'

EX_RESULT = IM_NUM1 * IM_NUM2.

ENDCASE.

ENDFUNCTION.

IF USEFULL REWARD