2008 Sep 10 10:22 AM
Ho to pass select options as a parameters in function module.
2008 Sep 10 11:01 AM
Ho to pass select options as a parameters in function module.
Hi,
If you know that only one or limited entires are there from the select-option, then pass all the select-option-low ( & select-option -high if it has ) then pass it as either using import or changing parameter. If the values in select-option are keep on changing then u can go with the above reply
Ho to pass select options as a parameters in function module.
2008 Sep 10 10:24 AM
2008 Sep 10 10:25 AM
2008 Sep 10 10:34 AM
Suppose s_matnr is your select option then u can pass
s_matnr-low and s_matnr-high (whichever you want) directly to the FM.
If you hav a list of selections then
Loop at s_matnr.
call fm<>
import
var = s_matnr-low
.
endloop.
Hope this helps!
Regards,
Prashant
2008 Sep 10 10:35 AM
hi
as per your query i can interpret that u need to pass your select option values into FM
for thhis firstly declare a variale or workarea or table as if type of FM parameter
now pass your select option value into it now pass that parameter to FM
hope it works
~hitesh
2008 Sep 10 10:38 AM
Hi
Do in the following way.
TABLES: mara.
DATA: r_matnr TYPE RANGE OF mara-matnr WITH HEADER LINE.
SELECT-OPTIONS s_matnr FOR mara-matnr.
LOOP AT s_matnr.
MOVE-CORRESPONDING s_matnr TO r_matnr.
APPEND r_matnr.
ENDLOOP.
CALL FUNCTION 'ZABC'
IMPORTING
I_RANGE = R_MATNR
EXPORTING
"....
.In Function Module.
Pass the table R_MATNR & Declare the range in FM as below.
I_RANGE TYPE RSDSSELOPT
2008 Sep 10 10:24 AM
Hi,
Just declare selection screen parameter match with Function module parameter and Give in Th FM.
Regards
JAna
2008 Sep 10 10:24 AM
2008 Sep 10 10:48 AM
There are ways to do it...
In the Function module using the Table parameter you can do it.
Have a table parameter to hold the select option , Don't type refer to any DDIC structure or field.
In the implementation of the function module you can do some thing like this,.
"example you want to pass matnr select option
data: r_selopt type range of matnr.
data: wa_opt like line of r_selopt.
r_selopt = table_param[].
in the call function side you pass the select option directly to the table parameter directly.
call function 'ZTEST_FUNCTION_SLECTOPTION'
tables
table_param = s_matnr.
2008 Sep 10 10:55 AM
Hi
If you use IN operator the check is considered as select-option variable/table, so declare a ranges table type and use this in your program and for the function module also as a table parameter. assign the selection-option to table parameter.
2008 Sep 10 11:01 AM
Ho to pass select options as a parameters in function module.
Hi,
If you know that only one or limited entires are there from the select-option, then pass all the select-option-low ( & select-option -high if it has ) then pass it as either using import or changing parameter. If the values in select-option are keep on changing then u can go with the above reply