2007 Dec 27 10:38 AM
Hi Experts,
Function Module " Ztest "
import num = num
export res = res.
in the function module, I am checking the condition as following:
if num is initial.
num = 100.
endif.
but, Syntax error is occuring that
"NUM cant be changed".
I want to assign new value to num like 200.
How do I assign ?
Please help me out.
thanks in advance.
regards
Sekhar
2007 Dec 27 10:42 AM
Hi,
Function Module " Ztest "
import num = num
export res = res.
where is the Data declarations for num and res in your calling program?
Is num mandatory or optional?
Check for them firstly.
Reward points if useful.
Anita
2007 Dec 27 10:42 AM
Hi,
Function Module " Ztest "
import num = num
export res = res.
where is the Data declarations for num and res in your calling program?
Is num mandatory or optional?
Check for them firstly.
Reward points if useful.
Anita
2007 Dec 27 11:17 AM
Hi Anita,
num is optional and type is i (but not constant)
in the FM,
if num is initial.
num = 100.
endif.
but it is showing syntax error
"num cant be changed".
thanks your reply
2007 Dec 27 12:57 PM
2007 Dec 27 2:32 PM
2007 Dec 27 10:43 AM
Hi Chandra,
It's impossible to change the value of IMPORTING parameters. Either you have to change the type to CHANGING or use a local variable.
Regards,
John.
2007 Dec 27 10:44 AM
Hi,
Inside the Function Module you can't assign the value for a Import Parameter.
But You can assign the value for "export" or "changing" Parameters.
Using Import parameters you can give Input to the Function Module, and Retrieve the result in Export Parameter.
If you want to assign the value to the Import parameter means ,
Num = 200.
Then Call the FM like,
Function Module " Ztest "
import num = num
export res = res.
Thanks.
2007 Dec 27 10:45 AM
Hi,
You can assign a default value to import parameter
in Default value
regrds,
siva chalasani.
2007 Dec 27 10:46 AM
hi chandra,
while declaring the import parameters in your function module use the default key word.
example:
""Local Interface:
*" IMPORTING
*" REFERENCE(number) TYPE i default '100'.
this will take 100 as the default value for num.
reward if found helpful.
thanks®ards.
2007 Dec 27 10:46 AM
U can pass that value in changing.
Function Module " Ztest "
changing num = num
export res = res.
try this.
Awrd POints if useful
Bhupal