‎2009 Jul 16 2:49 PM
Hi ,
I am trying to pass select-options values from my ABAP editor to Class metod.
its giving error like *The IN operator with "S_KUNNR" is followed neither by an internal table *.
I am not getting how to pass ranges values to method.
Get_data is my method. Importing s_kunnr type SELOPT.
SELECT kunnr
name1
ort01
adrnr FROM kna1
INTO TABLE it_kna1
WHERE kunnr in s_kunnr. can you let me know how to pass range values .
Regards,
sarath.
‎2009 Jul 16 6:52 PM
youhave to define your import parameter as RANGE, then you may pass select options.
in your class have types: t_kunnr_range type range of <data element of kunnr >
in your paramters of method have s_kunnr_range type t_kunnr_range.
while calling method do not forget to this.. Object->method( s_kunnr_range = s_sel_kunnr )
where s_sel_kunnr is defined as slection-options for kunnr on screen.
WELCOME TO OBJECTS!
CHEERS
‎2009 Jul 16 2:57 PM
HI ,
what ever u r importing that value we need to give.
ex.
methods:
getmara IMPORTING matgr TYPE C
EXPORTING l_tab TYPE ANY TABLE.
in
Method: getmara.
select matnr (some fileds ) from mara
where matkl = matgr.
endmethod.
Regards,
Bharani
‎2009 Jul 16 3:28 PM
Your IMPORTING PARAMETER is "Work Area" and not an "Internal Table" as the type refers to a Structure.
You need to define your Importing parameter using "Table Type". Then only you can use IN OPERATOR with your select Option
‎2009 Jul 16 4:53 PM
Hi,
Please refer to see how to pass and type your select options.
Regards
Marcin
‎2009 Jul 16 6:52 PM
youhave to define your import parameter as RANGE, then you may pass select options.
in your class have types: t_kunnr_range type range of <data element of kunnr >
in your paramters of method have s_kunnr_range type t_kunnr_range.
while calling method do not forget to this.. Object->method( s_kunnr_range = s_sel_kunnr )
where s_sel_kunnr is defined as slection-options for kunnr on screen.
WELCOME TO OBJECTS!
CHEERS
‎2009 Jul 16 8:00 PM
Hi ,
I solved my problem like this. As I am using global class.
for GET_DATA method.
importing s_kunnr type PIQ_SELOPT_T.
In editor.
SELECT-OPTIONS: s1_kunnr FOR kna1-kunnr.
DATA s_kunnr TYPE piq_selopt_t.
DATA wa_kunnr TYPE selopt.
wa_kunnr-sign = 'I'.
wa_kunnr-option = 'BT'.
wa_kunnr-low = s1_kunnr-low.
wa_kunnr-high = s1_kunnr-high.
APPEND wa_kunnr TO s_kunnr.
Regards,
sarath.
‎2009 Jul 16 8:02 PM
‎2009 Jul 16 8:34 PM
you are wrong.
like thsi you can enter only first line of select-options.
Remember select options is an internal table.
if you try to give more values with = ., <, > your logic will fail .
‎2009 Jul 17 6:34 AM
Hi Sarath,
While passing select options from your ABAP code to class method , pass like this
call method get_data exporting s_kunnr[] . Do remember to put square braces .
and in ur class method Import it via Type ANY
Thanks and Regards ,
Harsharandeep Singh