Skip to Content
0
Former Member
Oct 31, 2012 at 07:41 AM

select options in oops concept

476 Views

hi,

i am doing simple report using oops concept.

REPORT ztest.
TABLES:kna1.
CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS: getdata IMPORTING kunnr type kna1-kunnr,
displaydata.
PROTECTED SECTION.
types:BEGIN OF ta_data,
kunnr type kunnr,
END OF ta_data.
data:it_data type STANDARD TABLE OF ta_data,
wa_data type ta_data.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD getdata.
select kunnr from kna1 into TABLE it_data WHERE kunnr eq kunnr.
endmethod.
METHOD displaydata.
loop at it_data into wa_data.
write:/ wa_data-kunnr.
ENDLOOP.
endmethod.
ENDCLASS.
data:o type REF TO c1.
START-OF-SELECTION.
BREAK-POINT.
PARAMETERS : kunnr type kunnr.
CREATE OBJECT o.
call METHOD o->getdata
EXPORTING
kunnr = kunnr .
o->displaydata( ).

my dought is how we can use SELECT-OPTION IN place of PARAMETERS,

thanks,

Mohan.

Moderator message: very basic -> question status removed.

Message was edited by: Thomas Zloch