2008 May 22 10:29 AM
2008 May 22 12:07 PM
Hi Ravi,
If you want to pass the select-option values to the method (importing parameter), Convert select option values to range.after that you use the range in your method.
2008 May 22 12:05 PM
This is how you declare it..
DATA: gw_bukrs TYPE bukrs.
SELECT-OPTIONS: s_bukrs FOR gw_bukrs.
you can use s_bukrs as you do in normal ABAP.
Hope That Helps
Anirban M.
2008 May 22 12:07 PM
Hi Ravi,
If you want to pass the select-option values to the method (importing parameter), Convert select option values to range.after that you use the range in your method.
2008 May 22 12:14 PM
Hello Ravi
If you are interested in how to import select-options into class methods have a look at the following threads:
Regards
Uwe
2008 May 27 7:52 AM
hi,
you can use the formatt.
*"Table declarations...................................................
TABLES:
rbkp, " Document Header Invoice receipt
rseg, " Document Item: Incoming Invoice
eban, " Purchase Requisition
t001w. " Plants/Branches
*"Selection screen elements............................................
PARAMETERS:
p_gjahr LIKE rbkp-gjahr. " Fiscal Year
SELECT-OPTIONS:
s_belnr FOR rbkp-belnr, " Document number of an invoice
s_bldat FOR rbkp-bldat, " Document Date in Document
s_budat FOR rbkp-budat, " Posting Date in the Document
s_werks FOR rseg-werks. " Plant
reward if helpful.
regards,
srishti.
2008 May 27 8:15 AM
Hi,
Please find the code below using select-options in ABAP-OO.
Report ztest.
tables:marc.
select-options: s_matnr for marc-matnr.
class c3 definition.
public section.
types: begin of ty_marc,
matnr type marc-matnr,
werks type marc-werks,
end of ty_marc.
data: wa_itab type ty_marc.
data: itab type table of ty_marc .
data: wa_matnr type r_matnr.
methods: add.
private section.
*methods: sub.
endclass.
class c3 implementation.
method add .
select matnr
werks
from marc into table itab where matnr IN s_matnr.
loop at itab into wa_itab.
write: wa_itab-matnr,
wa_itab-werks.
endloop.
endmethod .
endclass.
start-of-selection.
data b1 type ref to c3.
create object b1 .
call method b1->add.
Best Regards
Suresh
2008 May 27 12:40 PM
Hi Ravi,
U can go ahead with normal way of putting the select-options in ur report as the Select-options will remains constant put in before the event flow or definitions.
cheers
Mohinder Singh
2008 May 27 1:44 PM
Hi All,
Thanks for ur replies.
I Knew this way to write select-options normally.But my doubt is how to pass these select-options as parameters in methods.Anyway i resolved this.
Regards,
Ravi S
2008 May 28 6:05 AM
Hi Ravi,
You have to define a type as below
TYPES:tr_matnr TYPE RANGE OF matnr.
DATA: gv_matnr TYPE mara-matnr.
SELECT-OPTIONS: so_matnr FOR gv_matnr.
----
CLASS lcl_example DEFINITION
----
CLASS lcl_example DEFINITION.
PUBLIC SECTION.
METHODS:
get_data
EXPORTING
so_matnr TYPE tr_matnr.
ENDCLASS.
----
CLASS lcl_example IMPLEMENTATION
----
CLASS lcl_example IMPLEMENTATION.
METHOD get_data.
SELECT COUNT(*)
FROM mara
WHERE matnr IN so_matnr[].
ENDMETHOD.
ENDCLASS.
If you have to pass it globally create a table type that has the same structure as select-opton ( that is low high sign option ).
PLEASE REWARD THE POINTS
Thanks & Regards,
Sujith
2008 May 28 8:44 AM
Hi,
You can do it like this....
Tables: MARA.
select-options: i_matnr like MARA-matnr.
Reward if helpful.
Regards,
Syed