Application Development 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: 

how write a class in abap

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

former_member194669
Active Contributor
0 Kudos

Hi,

Check Transaction Code ABAPDOCU

Its have lot of class examples

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member194669
Active Contributor
0 Kudos

Hi,

Check this link

Former Member
0 Kudos

Hello Deniz,

Here is the simple info...

reward if helpful.

-


Sasi.