05-19-2008 10:55 AM
hai friends...
in real time.
i declared itab to retrieve values .
and where can i declare select-options.
iam attaching my simple code ..
can anybody send me simple example...
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 .
methods add .
private section.
method sub importing value(itab) ..
endclass.
class c3 implementation.
method add.
select matnr
werks
from marc into table itab." where matnr in s_matnr.
*call method sub exporting value(itab1)
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.
parameters: s_matnr like marc-matnr.
here where can we delcare select-options ...
an di want to use both public and private methods how can i write...
tankx in advance ..
05-19-2008 11:31 AM
Hi,
Please find the modified code below.
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.
Edited by: mariosuresh on May 19, 2008 1:42 PM
05-23-2008 4:56 AM
01-04-2011 1:51 PM
05-19-2008 12:43 PM
12-24-2010 10:04 AM