Module Pool Programming
Module Pool Programming
+ -
It is a special type of programming which is used to create custom SAP screens.
Transaction code for creating module pool programs is SE8.
E!ery module pool program must "e e#ecuted with a transaction $T-code%.
E!ents in Module pool programming
There are four e!ents a!aila"le in module pool programming.
PBO (Process Before Output):Triggered "efore MPP screen is displayed.
PAI (Process After Input): Triggered after MPP screen is displayed whene!er user
raises an action. Also&'ow P() is also triggered.
POV (Process On Value Request): Triggered when *ser +lic,s on search help or -.
(utton.
POH (Process On Help Request): Triggered when *ser +lic,s on search help or -.
(utton.
Modulari/ation techni0ues in Module Pool
(asically there are four include programs which are created automatically for an MPP
program.
1MPP name23T)P 4top include program &All data declarations.
1MPP name23)5 4P() include program & All logic related to P() e!ent
1MPP name23I5 4PAI include program & All logic related to PAI e!ent
1MPP name23-5 4-orms include program & All logic related to su"routines
S+6EE'
It is a !isi"le layout which is displayed in the output. The components of the Screen are
+omponents of Screen7
Attri"utes 7 Properties of screen
Element 8ist 7 8ist of *I98i"rary elements
-low-8ogic 7 A"ap logic related to MPP
8ayout 7 Screen :esigning Area
-low 8ogic in module pool
It will contain the logic related to screen in the form of modules (y default& ; e!ents will
"e a!aila"le with their corresponding modules as "elow7 <ust uncomment the modules
and create them and write the a"ap logic.
P6)+ESS (E-)6E )*TP*T.
=M):*8E STAT*S35.
P6)+ESS A-TE6 I'P*T.
=M):*8E *SE63+)MMA':35.
M):*8E7
It is an su"-program which contains the A(AP code for a screen .
-low-8ogic cannot understand A(AP statements. So the entire A(AP code is
written in the form of modules.
Since the entire a"ap logic is di!ided in the form of modules& that is why it is
called M):*8E P))8 P6)>6AMMI'>
In the "elow e#ample we will create a simple Module Pool Program to display
hello world.
>o to SE8& select program from drop down& pro!ide name as
?SAP'3@E88)3A)68: and press enter.
The layout will "e li,e "elow& drag and drop Te#t -ield element on to screen area.
Sa!e& close windows& go to Eow logic& dou"le clic, on each module and add
"elow code.
:ou"le clic, on menu name and title to create >*I status for the
program...chec,out creating a custom menu in SAP to create menu.
:ou"le clic, on program name& right clic,& acti!ate.
To e#ecute a module pool program we need to create a t-code& to create a t-code
right clic, on program name& create& transaction.
+ -
6e0uirement7 :isplay material details for a material input "y designing a module
pool screen.
>o to SE8& select program from drop down& pro!ide name and press enter.
E#pand program& dou"le clic, on top include and add "elow code.
Module Pool layout designer will open& clic, on G:ictionary9Program Felds iconG
$see "elow image%& a popup will open& pro!ide name as AA3MA6A& clic, on G>et
from programG& select all rows and enter.
Mo!e mouse cursor on layout and place the form in suita"le position.
'ow clic, on te#t icon& put it "efore any input Feld and enter te#t.
Insert "utton& pro!ide te#t as G>et :ataG& dou"le clic,& pro!ide a name & fct code&
enter and close.
Sa!e and Acti!ate.