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: 

Business Object Repository and Class Library

Former Member
0 Kudos

Hello Gurus:

I am not really able to appreciate the difference and the need for it between object types in the BOR and object types in the class library.

What exactly is the difference in the way (say)BUS2054 and (say)CL_ALV_TREE_BASE are constructed and the way they function? Why is this done?

Thank you all in anticipation.

4 REPLIES 4

ssimsekler
Active Contributor
0 Kudos

Hi Richard

A business object type is a representation of a <i>business entity</i>. That is; it has a functional aspect. However, as of its definition and implementation it is more or less like an ordinary object in the context of object oriented methodology. First of all, it satisfies <b>encapsulation</b>. It has specific methods to be called but it is never wanted that the user can interfere in the technical infrastructure. So, it has more strict encapsulation to leave the user's focus on its business functionality. The infrastructure of a BO may comprise an object type of a class library, but this is not obligatory since object-orientedness is in functional aspect which also means inside there may be function modules which I know is the real case for now. Basicly, BO type has its object-orientedness functionally regardless of the methodology used for its implementation.

However, an object type in the class library is a technical aspect. It is just the OO methodology adapted in ABAP which can be easily understood by an ordinary developer.

To illustrate;

BUSXXXX has some business functionality related with a business entity in the system e.g. a material, a purchase order or an employee,

However, CL_XXXX is just technical and is used just so. Its functionalities have no relation with a business entity and it is utilized by the developer for its reusability for its demonstrational features.

Hope this much helps...

*--Serdar

0 Kudos

Hi Serdar,

Sorry for my late reply. Thank you very much for taking time and effort to explain a fundamental aspect beautifully.

So would you say a BOR is only to be used in workflows and that they can never be typed in an ABAP program?

Also do you know a way or transaction to get a where-used list of particular events in a BO.

Thanks again.

0 Kudos

Hi Richard

It is a pleasure to share my knowledge. In an aspect BOR is used functionally in business processes and have importance in integration issues, mainly in workflows (and now webflows). However, they are linked to the technical layer by business APIs (BAPIs).

To inspect BAPIs, you can use the transaction code <b>"BAPI"</b>. For Business Object Repository, You can use <b>"SWO1"</b>, <b>"SWO2"</b> and <b>"SWO4"</b> .

Hope this much helps...

*--Serdar

0 Kudos

For using Business objects, also have a look at the include CNTN01.

I recently stumbled upon this usage, and the example is of a CATT object. If you go to SW01, and for object type you will find the various interfaces, attributes, methods defined.


INCLUDE <CNTN01>.

data: 
  object     type swc_object,
  objtype    type swetypecou-objtype value 'CATT',
  objkey     type sweinstcou-objkey  value 'Z_TESTXK01',
  methodname type swotinvoke-verb    value 'EXECUTE'.
  container  type table of swcont.

OBJKEY is the key attribute of the object. For CATT, test case is the key attribute, and I have stored a test case called 'Z_TESTXK01'.

The method that I want to execute is called 'EXECUTE'.

First I create an object using the macro


swc_create_object

as defined in the include mentioned above.

To call a particular method, I use the macro


swc_call_method

This is how BOR objects can be used in ABAP context.

Serdar, thanks for sharing with us the difference between BOR and classes. More/Less I had a similar view, but you have explained it nicely.

Regards,

Subramanian V.