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: 

ABAP classes

Former Member
0 Kudos

Hello,

I need to do some work on ABAP classes which I have never done before. therefore, I have a couple of questions which I would appreciate if anyone could help me with:

First, what is the difference between all these classes compare to the traditional abap code.

Second, are these classes similar to the classes in JAVA?

Thirdly, is there any good place on the internet that offer some good introductory material on the topic?

Thanks a lot!

Regards,

Anyi

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

These are all good links, to answer your second question, yes ABAP classes are like java classes. ABAP and Java both use a simular Object Oriented model. One difference is that in java, the definition and implementation are merged together, in ABAP, they are separate.

There are some things that you can do in Java, that is not directly supported in ABAP objects, but you can mimic the functionality in other ways.

Regards,

Rich Heilman

7 REPLIES 7

Former Member
0 Kudos

Hi,

Check the transaction ABAPDOCU for examples of classes..

Thanks,

Naren

Former Member
0 Kudos

Hi Anyi,

See the below SAP link, you will get the answers

http://help.sap.com/saphelp_nw04/helpdata/en/b3/f4b1406fecef0fe10000000a1550b0/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/ee/e440a670a111d1b44c0000e8a52bed/content.htm

goto T.code <b>SE24</b>, press the F4, select oneClass the read the Documentaion of the Class, you will understand the use of that class

Regards

Sudheer

suresh_datti
Active Contributor
0 Kudos

I find this <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm">SAP Help</a> to be very useful..

~Suresh

ferry_lianto
Active Contributor
0 Kudos

Hi Anyi,

Please check this ABAP online document (starting page 1300).

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf

Regards,

Ferry Lianto

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

These are all good links, to answer your second question, yes ABAP classes are like java classes. ABAP and Java both use a simular Object Oriented model. One difference is that in java, the definition and implementation are merged together, in ABAP, they are separate.

There are some things that you can do in Java, that is not directly supported in ABAP objects, but you can mimic the functionality in other ways.

Regards,

Rich Heilman

uwe_schieferstein
Active Contributor
0 Kudos

Hello Anyi

In terms of coding the syntax checks and rules are more strict within ABAP classes, e.g. you cannot use itabs with header lines (thanks to SAP they banned this finally!).

However, in terms of thinking and structuring your coding it is completely different. If you are "thinking in objects" your focus basically on two design questions:

(1) How many different objects do I need for my application?

(2) Which attributes and methods do I need for my objects?

Within your application you do not care if you have a single business object or hundreds of them (e.g. sales orders, employees, etc.) but you only think about a single object and its required properties. If you have multiple instances of your object(s) then you simply collect them in an itab or another class (-> composition of classes).

Event handling is another huge advantage of ABAP-OO vs. classical ABAP because it allows loose coupling.

Similarity of ABAP classes with Java classes is quite obvious although there are some minor differences.

Understanding OO means understanding ABAP-OO, too. Thus, you should look for a good introduction to OO-design and OO-analysis. I can highly recommend the following books:

- Head First: Design Patterns

- Head First: Object-Oriented Analysis & Design

The can be found

<a href="http://www.headfirstlabs.com/index.php">here.</a>

Regards

Uwe

Former Member
0 Kudos

Hi Anyi

Regarding traditional ABAP Code we have a procedural approach of doing coding but when it comes to OOPS we need to have classes object and methods. Object oriented approach is easier than the procedural appraoch the main thing which we need to concentrate is on knowing about the classes and its method so for that we need to understand the requirement and Object oriented Design.Once you know the classes to be used you can create obeject of the same and call the respective method.Some times we need to create our own classes and methods that to is very easy in ABAP We can go in Class builder se24 and create as per requirement.

Classes have the same concept wether it be JAVA or ABAP ,only thing is that both have different set of inbuilt classes and methods.

you can refer Sapgenie.com , ittoolbox.com ,sdn.sap.com for getting good material on oops.

Thanks

AB