07-01-2009 6:58 PM
Hi Every body,
I have an issue regarding the usage of values from select-options in the methods of class. i dont know how to pass the values from select options as a parameter to the class method. i tried with ranges but it is skipping the single values in the select options. Thanks in adavance
07-01-2009 7:13 PM
You are on right track.
Crate a Range Table Type
You can create it as
TYPES: TY_R_MATNR TYPE RANGE OF MARA-MATNR.
Now, use this type to define your parameter of your method
methods:
get_data
importing
it_r_matnr type ty_r_matnr.
To pass your select-option you need to pass the internal table. Since Select-options are the internal table with Header line, you need to use this type of syntax to pass this select-option table to the method
select-options: s_matnr for w_mantr.
....
call metho lo_data->get_data
exporting
it_r_matnr = S_MATNR[]. "pass select-option with []s
Regards,
Naimesh Patel
07-01-2009 7:12 PM
I think you have two possibilities:
1) type parameter as SELOPT
2) define such type in public section of class.
TYPES t_rangetab TYPE RANGE OF your_type_or_field_here.
Now type your parameter as T_RANGETAB
Regards
Marcin
07-01-2009 7:13 PM
You are on right track.
Crate a Range Table Type
You can create it as
TYPES: TY_R_MATNR TYPE RANGE OF MARA-MATNR.
Now, use this type to define your parameter of your method
methods:
get_data
importing
it_r_matnr type ty_r_matnr.
To pass your select-option you need to pass the internal table. Since Select-options are the internal table with Header line, you need to use this type of syntax to pass this select-option table to the method
select-options: s_matnr for w_mantr.
....
call metho lo_data->get_data
exporting
it_r_matnr = S_MATNR[]. "pass select-option with []s
Regards,
Naimesh Patel
07-01-2009 7:40 PM
Thanks for the answers.
I have used the same way as you guys specified before it self but problem is with the single values in the select options are not considering in the above solutions. i have not tried with SELOPT. Any way i solved the problem temporarily by writing the code for selection screen before the local calss definition and used the select options variable directly in the method. i know this is not the efficient method. Any way thanks for the quick response.