09-03-2007 7:25 AM
Hi abap experts,
I want to write a class with abap, a simple calculator class for example,
how can I start to write..
The steps are what ?
Thanks.
09-03-2007 7:37 AM
1>go to se24
2>give your own class name say zcalculate
3>In the methods describe a method with the name say calculate
4>give parameters to calculate a product of 2 no's let the parameters b
a importing
b importing
c exporting
you can also give exceptions if any
in the method you can give
c = a * b
endmethod
thnkx
bhanu
09-03-2007 7:28 AM
Hi,
Check Transaction Code ABAPDOCU
Its have lot of class examples
a®
09-03-2007 7:30 AM
Hi,
We can write the class directly in SE38 program is called as local Class
Or we can also declare the class in SE24 which is used in any reports and called as globule class.
Rewards if useful..
Regards,
Minal
09-03-2007 7:31 AM
Hi
Defining class
A class is a set of objects that have the same structure and the same behavior. A class is
therefore like a blueprint, in accordance with which all objects in that class are created.
The components of the class
are defined in the definition
part. The components are
attributes, methods, events,
constants, types, and
implemented interfaces. Only
methods are implemented in
the implementation part.
<b>CLASS CLASSNAME DEFINATION.
ENDCLASS
CLASS CLASSNAME IMPLEMATION
ENDCLASS</b>
The CLASS statement cannot be nested, that is, you cannot define a class within a class.
REWARD IF USEFULL
09-03-2007 7:37 AM
1>go to se24
2>give your own class name say zcalculate
3>In the methods describe a method with the name say calculate
4>give parameters to calculate a product of 2 no's let the parameters b
a importing
b importing
c exporting
you can also give exceptions if any
in the method you can give
c = a * b
endmethod
thnkx
bhanu
09-03-2007 7:41 AM
09-03-2007 7:46 AM