Application Development and Automation 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: 
Read only

General ABAP to OOPS

Former Member
0 Likes
1,267

Hi all,

We have a report written in general ABAP.Now we would like to convert the same to Object oriented.what would be the best practice?

BR,

Disha.

Hi all,

We have a report written in general ABAP.Now we would like to convert the same to Object oriented.what would be the best practice?

BR,

Disha.

10 REPLIES 10
Read only

Former Member
0 Likes
1,229

you can use local or global classes to do the same,

if its an ALV report u can create a container , and use the class CL_GUI_ALV_GRID

Read only

0 Likes
1,229

This message was moderated.

Read only

Former Member
0 Likes
1,229

Hi,

One more query....Is there any tool by means of which we can convert existing general ABAP programs to Object Oriented which includes dialog programming?

BR,

Disha.

Read only

0 Likes
1,229

I dont think there is any such tool.. you will have to re-write the program in the new design.. or replace any function calls in the current program with methods etc..

~Suresh

Read only

0 Likes
1,229

Hi,

Can you give me some example for calling a FM with an object oriented approach?

BR,

Disha.

Read only

0 Likes
1,229

in object oriented we use only methods i guess instead of FMs

CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = WA_LAYOUT

CHANGING

IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF

IT_OUTTAB = IT_WRT_OFF_FLDS[].

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,229

Hello Disha

I believe that the best starting point for this conversion is the requirements document for this report.

Read the document carefully and see if you can identify specific "business objects".

Each of these "business objects" may become an own class.

Very important: if, for example, your report is dealing with lots of invoices do NOT care about the quantity but think exclusively about ONE "invoice object".

Next identify for each object the required methods.

Finally, compose your objects together. For this you will probably need another class.

I can give you an example of a "report" I have written recently:

This "report" deals "Actual Assessment Cycles" (transaction KSU2). Because it was a dialog I created three classes: controller class, model class and view class (MVC architecture). I had about six different classes (for objects "CATS data", "employee", "Cycle", "Exceptions",...) that I composed together into the model instance (which should hold the buinsess logic). The view instance contained the controls for display (three ALV lists) and the controller instance was responsible for handling the user interactions.

A final remark: There are only rare occasions where we should use local classes. In general, create global classes (even if nobody else will use them) because the transparency is much better than with local classes (especially if the classes become bigger and bigger).

Hope I could give you some ideas.

Regards

Uwe

PS: It's worthwhile doing this shift from classical ABAP to ABAP-OO.

Read only

0 Likes
1,229

Hi Uwe,

Can you please mail me the sample code at the foll ID ->[email protected].

BR,

Disha.

Read only

0 Likes
1,229

Hi all,

A very simple query:In OOPS,how do i call the BAPI "BAPI_CUSTOMERRETURN_CREATE"?

BR,

Disha.

Read only

0 Likes
1,229

Hi,

Anyone any suggestions?

BR,

Disha.