Application Development 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: 

Calling Functional module

Former Member
0 Kudos
105

Hi,

when iam calling functional modiule I am getting the errors,

REPORT ZAC_TAB25.

CALL FUNCTION 'ZAC_CALCULATE'.

EXPORTING

IM_NUM1 = P_NUM1,

IM_NUM2 = P_NUM2,

IM_OPER = P_OPER.

IMPORTING

EX_RESULT =

.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

DATA:

W_RESULT TYPE C.

Error iam getting is Comma without preceding colon (after EXPORTING ?).

1 ACCEPTED SOLUTION

Former Member
0 Kudos
71

Hi,

do this....

REPORT ZAC_TAB25.

CALL FUNCTION 'ZAC_CALCULATE'.

EXPORTING

IM_NUM1 = P_NUM1,

IM_NUM2 = P_NUM2,

IM_OPER = P_OPER,

IMPORTING

EX_RESULT =

.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

DATA:

W_RESULT TYPE C.

***do reward if usefull

vijay

9 REPLIES 9

Former Member
0 Kudos
71

Hi,

Either You have to pass EX_RESULT = value or comment importing parameter.

Reward if useful!

Former Member
0 Kudos
71

Pass W_RESULT.

Reward if useful!

Former Member
0 Kudos
72

Hi,

do this....

REPORT ZAC_TAB25.

CALL FUNCTION 'ZAC_CALCULATE'.

EXPORTING

IM_NUM1 = P_NUM1,

IM_NUM2 = P_NUM2,

IM_OPER = P_OPER,

IMPORTING

EX_RESULT =

.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

DATA:

W_RESULT TYPE C.

***do reward if usefull

vijay

0 Kudos
71

hI,

i had done in this way. still it is showing error.

REPORT ZAC_TAB25.

CALL FUNCTION 'ZAC_CALCULATE'

EXPORTING

IM_NUM1 = P_NUM1

IM_NUM2 = P_NUM2

IM_OPER = P_OPER

IMPORTING

EX_RESULT = W_RESULT

.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

DATA:

W_RESULT TYPE C.

Field "P_NUM1" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .

Message was edited by:

rams s

0 Kudos
71

Hi,

Change your code as

REPORT ZAC_TAB25.

DATA:

W_RESULT TYPE C.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

CALL FUNCTION 'ZAC_CALCULATE'

EXPORTING

IM_NUM1 = P_NUM1

IM_NUM2 = P_NUM2

IM_OPER = P_OPER

IMPORTING

EX_RESULT = W_RESULT

.

Reward points if useful.

Regards,

Atish

0 Kudos
71

the problem is you are declaring the variables after calling them in the fn module..

do like this

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C.

DATA:

W_RESULT TYPE C.

CALL FUNCTION 'ZAC_CALCULATE'

EXPORTING

IM_NUM1 = P_NUM1

IM_NUM2 = P_NUM2

IM_OPER = P_OPER

IMPORTING

EX_RESULT = W_RESULT

.

still one doubt is there you are not assigning the value to export parameters here then what is the need of importing the parameters?

regards

shiba dutta

Former Member
0 Kudos
71

hi,

U need to dynamically pass a variable to get the result for EX_RESULT.

0 Kudos
71

HI,

REPORT ZAC_TAB25.

PARAMETERS:

P_NUM1 TYPE I,

P_NUM2 TYPE I,

P_OPER TYPE C,

WA_RESULT TYPE I.

CALL FUNCTION 'ZAC_CALCULATE'.

EXPORTING

IM_NUM1 = P_NUM1

IM_NUM2 = P_NUM2

IM_OPER = P_OPER

IMPORTING

EX_RESULT = WA_RESULT.

Regards,

Sesh

Former Member
0 Kudos
71

Hi,

Try this:

REPORT ZAC_TAB25.

CALL FUNCTION 'ZAC_CALCULATE' "see change
EXPORTING
IM_NUM1 = P_NUM1 " see change
IM_NUM2 = P_NUM2 "see change
IM_OPER = P_OPER "see change
IMPORTING
EX_RESULT = "fill here some para value or coment this and above line
.
PARAMETERS:
P_NUM1 TYPE I,
P_NUM2 TYPE I,
P_OPER TYPE C.

DATA:
W_RESULT TYPE C.

Better use pattern butto to insert fm.

Jogdand M B

Message was edited by:

Jogdand M B