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

Calling Functional module

Former Member
0 Likes
1,146

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
Read only

Former Member
0 Likes
1,112

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
Read only

Former Member
0 Likes
1,112

Hi,

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

Reward if useful!

Read only

Former Member
0 Likes
1,112

Pass W_RESULT.

Reward if useful!

Read only

Former Member
0 Likes
1,113

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

Read only

0 Likes
1,112

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

Read only

0 Likes
1,112

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

Read only

0 Likes
1,112

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

Read only

Former Member
0 Likes
1,112

hi,

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,112

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

Read only

Former Member
0 Likes
1,112

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