Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to do programing using OO-ABAP

Former Member
0 Likes
464

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.

3 REPLIES 3
Read only

Former Member
0 Likes
430

Check in ABAPDOCU transaction. There are some examples programs available.

also check here...

http://saptechnical.com/Tutorials/OOPS/MainPage.htm

Read only

Former Member
0 Likes
430

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

Read only

0 Likes
430

hi

now i am refering examples given in ABAPDOCU.

thanx for valueable replay