0% found this document useful (0 votes)
12 views13 pages

Module Pool Programming

Uploaded by

modiboyinadivya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

Module Pool Programming

Uploaded by

modiboyinadivya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Module Pool Programming Version IT

Introduction
 It’s a special type of program where we will design the
screen and the corresponding ABAP program
 This type of Program we will be seeing in WM and
EWM/ As well as in product-based companies
 The Tcode for creating the MPP  SE80
 When ever we want to execute the MPP we can’t
directly execute them we always need a T-code
 When ever we create a MPP Screen we will have 4
events
o PBO  Process Before Output  It will gets
triggers before the o/p is getting Displayed
o PAI  Process After Input  After the Input values
this event will trigger
o POV  Process on Values Request  F4 Help same
as Selection screen on Values Request for
o POH  Process on Help Request  F1 Help Same
as Selection Screen on Help request for.
Logical flow of the MPP:
Module Pool Programming Version IT
 For Every Event We will be having a Module in that
Module we are going to write the ABAP Logic i.e., we
will call it’s as the module pool programming
 When ever we create an MPP we will be having 4
includes
o <Name of MPP>_TOP  Top Declarations / Class
Definition
o <Name of MPP>_o01  PBO logic
o <Name of MPP>_i01  PAI logic
o <Name of MPP>_f01  Sub routines/ Class
Implementation
 Note: MPP we can’t able to execute as a background job
but if we want to execute then we need to do the screen
recording and we need to upload the file i.e on top of
MPP we will create a SE38 program with that SE38 we
will calling this MPP.
For Every MPP We need to Design a Screen. To design the
screen, right click on the program name and click create and
click on screen and Provide the Screen Number.
Screen: It’s a visible layout which is used to display the input
or to display the output
Components of the screen:
 Attributes
o Description of the screen
o Type of screen
 Normal screen  95%
 Sub screen 5%
Module Pool Programming Version IT
 Dialog box
 Selection screen
o Next screen number  what will be the next
screen, if we are not providing the next screen
number SAP will consider the same screen has the
next screen number.
o Setting of the screen
 Element list
o What ever the variables/fields we are creating the
MPP screen/ Screen layout that will be shown in
the element list.
 Flow – logic
o It will contains the logic related to screen in the
form of modules
o By default 2 events will be available with the
corresponding module name
o Just uncomment these moudles and write the
corresponding business logic in the particular
include program.

Module in the flowlogic :


 It’s a sub-program which contains the ABAP code for
that screen.
Module Pool Programming Version IT
 Flow-logic cannot understand the ABAP logic, so entire
piece of code has be write in the from of module.
 Since the abap logic is writing in the modules we will
called this as the module pool programming
 MPP  ABAP CODE(Inside the modules) + SCREENS

 Layout  this is used for designing the MPP screen. We


can also called the layout has the screen painter.
Steps to create the Tcode for the MPP:
1. to create the Tcode for MPP we need a program which
is having a screen associated with it
2. goto SE93 and provide the Tcode name as per the
naming conventions and click on create
3. in the popup window, provide the description of the
Tcode and select the radio button Program with Dynpro
(Dialog Transaction) and click on continue.
4. Provide the Program and the initial screen
number/starting screen number
5. Select all the check boxes i.e., to which GUI this Tcode
must support.
6. Click on save by providing the TR and package.

Real time example: I want to display the material type,


Material description, Industry sector and base unit of
measure, whenever I pass the data of material number.

Req: I want to display sales order header details: VBAK


Module Pool Programming Version IT
VBELN, ERNAM, ERDAT, VKORG, VTWEG, SPART, AUART
I need the vbeln as a mandatory field and even I need a
validation the VBELN
For the sales order I need a F4 help the field to be displayed
in the F4 are Vbeln, Vkorg, vtweg and spart.
I need also a custom F1 help for the sales order.

Call Screen: This statement is used to call the specific screen


from the current screen.
POV: Process on value request  this is used to have an F4
help to the particular field, this is similar to AT SELECTION
SCREEN ON HELP REQUEST
Single filed Validation:
TO do the validation in the module screen field
what is the importance of field <Field Name> module <
module name>  This is used to do the validation on module
Module Pool Programming Version IT
screen field  this we will write it in PAI before my actual
logic starts.
When we compare this with report  AT SELECTION SCREEN
ON <Filed>

Multiple filed validation:


CHAIN – END CHAIN  This is used to do the validation on
multiple field  This is like the event AT SELECTION SCREEN.
(Report event)
Syntax:
CHAIN.
Field: <field name1>
<field name2>
<field name3> module <Module Name>.
ENDCHAIN.
Difference between single field and multiple field validation:
Single Field validation:
1. Its is used to validate on a single field
2. Only the filed which we are validating will be input
enables and the remaining field will get disabled.
Multiple field validation:
1. Its is used to validate on multiple fields
Module Pool Programming Version IT
2. All the field in between the chain – endchain will be
enabled and remaining field will get disabled.

Using Check Boxes MPP:


Based on the user interaction the o/p has to be come up then
we will use these check box.
Req: I need the 3 check boxes in the module pool screen
1. Sales order
2. Delivery
3. Invoice
I need o/p field
Sales order, Delivery number, invoice number
I need an another text field : which check box I have selected
1. User cant able to select 2 check box’s at a time
2. By default when ever I execute the tcode the check box
sales order has to be selected.
3. When ever the user as selected the sales order check
box, he has to only pass the values of sales order
number i.e., if the use has passed delivery or invoice
then we need to through an error.
a. If along with sales order number, if the user has
passed deilvary and invoice again the system has to
show an error.
4. The above 3 point is applicable for delivery and invoice
5. If the sales order number, the corresponding delivery
and invoice has to displayed ( VBAK, VBPA, LIKP, VBRK)
Module Pool Programming Version IT
6. The same step will be applicable for delivery and
invoice.
7. Check validation on sales order number, delivery
number and invoice number

Using the radio button MPP:to use the radio buttons we


need to assign these radio buttons to a radio button grp.
 In the layout, double click on the parameter/radiobutton
and provide the radio button grp name.
 Req: I need 7 Radio button in the screen, what ever the
radio button I have selected, the system has to open
the corresponding Tcode, below are the screen and its
Tcode:
 Req 2: Repeat the Req in check box’s
Module Pool Programming Version IT

Requirement 3:

When the user click on create, I has to open a seperate screen with the details which are there in
the employee table at the last i need a Save button, when the user click on Save it has to save to
the data base ( User Name, Data and Time must be the Auto updated)

When the user click on change I need a selection screen variable Employee ID, Emp First and
Emp last name in one single line

Its has to display the details (field must be non editable) and i need a button change over the
user click on change its to open all those fields that means make the fileds as editable and i need
a new button called save, once you done any changes then only the save to the db has be
happen i.e,. in the edit if I haven’t changed any data and when I click on save I need a message
“No changes Made”

When the user click on delete I need a selection screen variable Employee ID, Emp First and
Emp last name in one single line

Its has to display the details (field must be non editable) and i need a button change over the
user click on Delete, when the user click on delete I need a popup window as a warning message
that are you to delete the data ( Yes and NO), if the user click on Yes It has to delete from the
Data base.

Repeat the same thing for Student and course table


Module Pool Programming Version IT

Tab Strips: its used to divide the main screen into multiple subscreen and these sub screen we
will call it as tab strip

 For ever screen we have create the sub screen area i.e., we have to provide a screen
number for every screen area
 When ever we select click on the tab strip SAP will provide with 2 tabs
 Syntax for calling the tab strip:
o Controls: <Tab strip name> type TABSTRIP  we will declare in the top
declaration
 Syntax for calling the sub screen areas:
o CALL SUB SCREEN SUBAREA1 including sy-repid <Tab strip screen number>
 PBO of the my main screen

Requirement of Tabstrips:

I need Selection Screen with customer number


19th Oct 2022
I need 4 tabs  KNA1, KNB1, KNBK, KNVI

When the click on enter I has display the customer details, customer bank details, customer
company code details, customer master Tax indicator details as 4 tab.

I need a validation for my customer number and I need F4 and I need a conversion exit.

All the fields in the 4 tab must be in display mode.

Call screen/Set screen/leave to screen:

Call screen: This is used to call the next screen in the MPP and event set screen is used to call the
next screen in the MPP then what is the difference between the call screen and set screen, in call
screen once the execution of the screen got completed, the cursor will come back to my original
screen from where we have call the call screen where the set screen once after execution of this
screen it wont come back.

Syntax: CALL SCREEN <Screen No >

SET SCREEN <Screen No>

Leave to screen: the current screen will stop the execution and it will go back to screen number
which we provided the leave to screen.

Syntax: LEAVE TO SCREEN <Screen N0>

LEAVE Screen: this is also same like leave to screen but the difference is leave back will go back to my
previous screen where to leave to screen will go back to screen number which we provided.

Requirement:

Screen 1:
Module Pool Programming Version IT

If the user click on employee details, the system has to call a new screen

When user click on Student details


Module Pool Programming Version IT

Table control: its an element used to display the data in the form of a table is called the table
control.

In this, we need to consider 3 points.

1. Table control declaration


2. In the PBO we need to write a statement loop at itab into wa and endloop.
3. IN the PAI we need to write on more statement LOOP AT ITAB – ENDLOOP.

The table control syntax declaration:

Controls: <Name of the table control> type table view using screen <Screen No>.

PBO event: we need to write the loop at itab into wa – endloop this is used to fill the table records

Systax in the PBO event:

LOOP at ITAB INTO WA with control <Table control name >.

ENDLOOP.

PAI event: we need to get the data from the table control into my ITAB.

This below flow will be happen in my PBO event:

ITAB WA Table control

In the PAI event:

ITAB
Table control
Module Pool Programming Version IT

Req:

You might also like