‎2007 May 14 12:22 AM
Hello...
I just wanted to know how u create a give modulepool programming in classes and objects.Could anyone tell me the procedure how to do so.And i knew that module pool programming has become obsolete and now everyone are using object oriented concept in module pool programming.soo i want why r they using soo and what is the drawback in using the module pool programming instead of oops concepts.Could anyone give me the clear explanation..
‎2007 May 14 5:33 AM
Hello Chadipriya,
You can create module pool program for both ABAP and ABAP OO(Object Oriented).
The thing is in OO u have to declare classes,objects and methods.
<b>Procedure oriented approach</b>
1. Emphasis on tasks
2. Large programs are divided into smaller programs known as functions
3. Most of the functions share global data
4. Data move openly around the system from function to function
<b>Object oriented approach</b>
Emphasis on things that does those tasks
Programs are divided into objects
3. Data structures are designed such that they characterized the objects
4. Functions that operate on the data of an object are tied together in the data structure
5. Data can be hidden and cannot be accessed by external functions
6. New data and functions can be easily added whenever necessary
Go to SE80 ---> Select Program ---> Give ur program name and type this code below :-
REPORT YSUBDEL LINE-SIZE 120.
CLASS parentclass DEFINITION .
PUBLIC SECTION.
DATA : commondata(30) type c value 'Accessible to all'.
METHODS : SHOWVAL.
PROTECTED SECTION.
DATA : protectdata(40) type c value 'Protected data'.
private section.
data : privatedata(30) type c value 'Private data'.
ENDCLASS.
CLASS parentclass IMPLEMENTATION.
METHOD : SHOWVAL.
write:/5 'All data from parentclass shown:-'.
write:/ sy-uline.
WRITE:/5 COMMONDATA,
/5 PROTECTDATA,
/5 PRIVATEDATA.
endmethod.
endclass.
CLASS childclass DEFINITION INHERITING FROM parentclass.
PUBLIC SECTION .
METHODS : subval.
ENDCLASS.
CLASS childclass IMPLEMENTATION.
method : subval.
skip 1.
write:/5 'Data of parent shown from child-'.
write:/5 sy-uline.
WRITE:/5 COMMONDATA,
/5 PROTECTDATA.
Commondata = 'Public data changed in subclass'.
Protectdata = 'Protected data changed in subclass'.
write:/5 sy-uline.
WRITE:/5 COMMONDATA,
/5 PROTECTDATA.
endmethod.
endclass.
You r using OOPs concepts in module pool program and not module pool programming instead of oops concepts.
<b>Reward points if helpful</b>
Thanks,
Sachin
‎2007 May 14 2:38 PM
Hi Sachin,
Thanks for ure reply.
I understood the program what u have sent me.But i just wanted to know how will u relate this to modulepool programing.I heard that we can use oops concepts in modulepool programming and also we can write the modulepool programming from scrach in oops concepts.Actually i dont know both the procedures.I would like to appreciate if u could tell me in more detail ..like taking an example in modulepool program and tell write the same thing in oops concepts or atleast useing the oops concepts in that modulepool program.
‎2007 May 14 6:29 AM
check this weblog
<a href="/people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming">OO ABAP Dynpro Programming</a>
Raja
‎2007 May 14 2:47 PM
Hi Raja,
Thanks for the reply.
I couldn't understand that exactly.Could u plz take an example of modulepool programming and relate that to oops concepts.
‎2007 May 14 9:12 AM
‎2007 May 14 2:43 PM
Hi Mrutyunjaya,
Thanks for the reply.
Could u plz tell me in more detail taking an example of modulepool and writing the same logic in oops concepts or atleast using oops concepts in modulepool programming.