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

Module pool program with OOPS

Former Member
0 Likes
968

Hi friends,

am working on module pool program i want to use oops concept in moduel pool.can any body give me an example in

module pool with oops .

Thanks in advance,

sai.

2 REPLIES 2
Read only

MarcinPciak
Active Contributor
0 Likes
534

Refer [OO ABAP Dynpro Programming|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417200)ID1499581750DB00846827574872700296End?blog=/pub/wlg/2322]

Regards

Marcin

Read only

Timo_John1
Active Participant
0 Likes
534

Hello,

we have uses ABAP OO and Classic Dypros in our current projekt a lot.

It turned out to be the best way to it like this:

1. Create your Dynpro

2. Create an Interface that corresponds only to that Dynpro.

3. In the Modules of the dynpro you only call Methods from that interface created above, also all checks of Dynprofields etc should be handled in the Implelmentation of the methods. so you do like that:

Module set_vbeln.
   gi_dynp_class->set_vbeln( gs_sd-vbeln ).
endmodul.

gi_dynp_class is from type of your interface.

4. Create an application class that implements all the methods of the interface with the logic needed. Using inheritance you can easily reuse the the Dynpro in different contexts with different Application classes behind it.

5. In PBO of the dynpro you have to make sure that the the variable gi_dynp_class is bound. So you will cast your application class instance to it:

gi_dynp_class ?= gi_app_class.

The application class must be instanciates at the beginning of the program before the dynpro is used.

As a class can implement several interface you can enable you application class for as many dynpros as you want to.

Hope that helps a bit ...

Greetings from Hamburg