‎2008 Feb 12 10:24 AM
hi
i am new to learn OO-ABAP , i have created a class having 4 methods , but now required guidance form u all in making a simple reports using that class nad methods of that .
if some STD. simple examples avil. in SAP , plz tell me abt that .
plz help.
‎2008 Feb 12 10:39 AM
Check in ABAPDOCU transaction. There are some examples programs available.
also check here...
‎2008 Feb 12 10:39 AM
hi,
CLASS C_COUNTER DEFINITION.
PUBLIC SECTION.
METHODS: SET_COUNTER IMPORTING VALUE(SET_VALUE) TYPE I,
INCREMENT_COUNTER,
GET_COUNTER EXPORTING VALUE(GET_VALUE) TYPE I.
PRIVATE SECTION.
DATA COUNT TYPE I.
ENDCLASS.
CLASS C_COUNTER IMPLEMENTATION.
METHOD SET_COUNTER.
COUNT = SET_VALUE.
ENDMETHOD.
METHOD INCREMENT_COUNTER.
ADD 1 TO COUNT.
ENDMETHOD.
METHOD GET_COUNTER.
GET_VALUE = COUNT.
ENDMETHOD.
ENDCLASS.
The class C_COUNTER contains three public methods - SET_COUNTER, INCREMENT_COUNTER, and GET_COUNTER. Each of these works with the private integer field COUNT. Two of the methods have input and output parameters. These form the data interface of the class. The field COUNT is not outwardly visible.
Use create object statement to create object of the following class.
Data cref1 type ref to C_counter.
Create object cref1.
Hope this helps, Do reward.
Edited by: Runal Singh on Feb 12, 2008 4:11 PM
‎2008 Feb 13 4:22 AM
hi
now i am refering examples given in ABAPDOCU.
thanx for valueable replay