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: 

Need business example in OOPS report.

Private_Member_49934
Contributor
0 Kudos

Dear Experts,

I have a firm foundation in Object oriented concepts as I have been in J2EE and C++ . Now I am in abap for the last 2 Years But yet I am not able to get myself fully into OO Reports in ABAP. I tried searching for in the forum and wiki but didn't find the exact answers there. Mostly people talk about OO ALV . And for OO reports the examples given are car and vehicle sort of things and not in terms of FI Documents or Materials and Inventory. Even if you find one, they will suggest using static methods instead of forms. Again in this case I feel this is not the best use of OOPS but just to replace Procedural with Object oriented.

I am well aware with the concepts and If I have a UML/ Use Case in front of me I can write the code. But my problem is I am able to frame the UML. I know about MVC architecture but am getting afraid to put into OOPS because the procedural makes it too simple and fast .

Say take an example of material. We can either declare a type say ty_material with the required fields or a class say lcl_material with all the fields as attributes.

I am not able to express my confusions.

I will be really thankful if some one can give me a few REAL OBJECT ORIENTED report that can help me getting started.

With Great Hopes,

KG

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kumar

If you are looking for hard-core ABAP-OO programming then have a look at the RE-FX (Flexible Real Estate) component of SAP.

Without deep understanding of OO-concepts you will be totally lost in these applications.

Regards

Uwe

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kumar

I have found my RE-FX example which I published some time ago in the SDN:

[Understanding ABAP Objects|http://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/UnderstandingABAPObjects]

Regards

Uwe

0 Kudos

Hello Uwe,

Though the RE-FX was not relevant to me, but what i really appreciated in the Wiki are the sections "Comparing Classical vs. ABAP Objects Approach" & "Conclusions".

I have a question though. I am more or less comfortable with the concepts(although i've not used too many of them) but i am still not able to relate OO principles to day-to-day scenarios. If you have read Horst Keller's OO-ABAP book, you'll understand where i'm coming from.

E.g., In the book he relates EVENTS in OO-ABAP to the scenario of a pilot / passenger are calling for the service of a flight attendant.

Do you think that this kind of perception is a "must"?

I console myself saying, "May be i'm in the phase of the transition from Procedural ABAP to OO-ABAP. Hence this lack of visualisation!"

Will be really happy to hear your comments!

Cheers,

Suhas

0 Kudos

Hello Suhas

"Think big, start small!"

That's the way how you should enter the ABAP-OO world. Given the fact that you have already a solid understanding of object-orientation your way into ABAP-OO will be much easier than mine (learning by doing without having a background from another OO-language).

I have not read the book by Horst Keller so I cannot really comment on his approach. However, I can tell you a few of the lessons I have learnt so far.

Example: Reading details from a business object, e.g. employee

In the procedural ABAP world we were looking for a function module or even a BAPI (..._GET_DETAIL) to access employee data (people suggesting to make a SELECT * FROM PA... disqualify themselves and should not be regarded ABAP "developers").

In ABAP-OO we extend our search to classes (and interfaces). In this case you hopefully find [CL_PT_EMPLOYEE|https://wiki.sdn.sap.com/wiki/display/Snippets/UnifiedAccesstoAllHR+Infotypes]. It takes a little time to understand its method but then you have a single "handle" to access all HR infotypes.

Coming back to the slogan from the beginning: it is quite unlikely that you may get the opportunity to develop an entire class hierarchy (quite often SAP has done this already for us). Instead you will develop quite often composites consisting of many different classes (like in the RE-FX example).

Use the powerful implementation of standard classes, e.g.

[CL_RECA_MESSAGE_LIST|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12377] [original link is broken] [original link is broken] [original link is broken]; (Message Handler)

CL_ABAP_CONTAINER_UTILITES (helps you to move structured / unstructured data back and forth on Unicode systems)

[CL_PO_HEADER_HANDLE_MM|http://wiki.sdn.sap.com/wiki/display/ABAP/Purchaseorderitem-cl_po_header_handle_mm] (makes your developer life easy when working on MM - Purchasing)

"Think big, start small!"

"Start now!"

"Grab every chance to use existing classes and create your own whenever necessary."

Regards

Uwe