0% found this document useful (0 votes)
79 views

Dialog Programming

Module pool programming is a type of ABAP programming used to build custom SAP screens. It uses screen painters to design screens with UI elements. The screens and business logic are connected through events like process before output, process after input, process on value request, and process on help request. These events trigger ABAP modules that contain the core business logic. Workbench transactions like SE51 for screen painter and SE38 for ABAP programming are used to develop module pool programs.

Uploaded by

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

Dialog Programming

Module pool programming is a type of ABAP programming used to build custom SAP screens. It uses screen painters to design screens with UI elements. The screens and business logic are connected through events like process before output, process after input, process on value request, and process on help request. These events trigger ABAP modules that contain the core business logic. Workbench transactions like SE51 for screen painter and SE38 for ABAP programming are used to develop module pool programs.

Uploaded by

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

Module Pool Programming

1
 Overview of Module Pool Programming
 Overview of Module Pool Programming
 Screen Painter & Screen Flow Logic
 Screen Painter & Screen Flow Logic
 Simple UI Elements
 Simple UI Elements
 Input Validation
 Input Validation
 Navigation
 Navigation
 Static Navigation
 Static Navigation
 Dynamic Navigation
 Dynamic Navigation
 Complex UI Elements
 Complex
 UI Elements
Tables
 Tables
 Tab strip
 Tab strip
 Sub screen
 Sub screen

2
Module pool Programming overview

Module pool is a collection of screens ,flow logic ,menu bar and ABAP code that is used to build an application.

It is special type of programming to build the custom SAP screen as per business requirement.

• These are type M programs in SAP.


•  Screen painter is a tool used to create GUI in ABAP.
•  MPP provides screen painter to create a screen for the program.
•  These programs cannot be executed directly.
•  Customer-specified Transaction code (starting with Z or Y) should be created for each MPP program to execute.
•  We can create any number of screens for a program and we can call these screens very easily.
•  MPP programs should start with the naming convention SAPMZ or SAPMY.
•  SE80 is the Tcode to create MPP programs.

3
Module pool Programming overview
Module pool program
program // Dialogue programming is
is a sequence of screens and logic
logic behind these
these screen
screen . It contains
two main programs
1.
1. Dynpro
Dynpro (Screen
(Screen ++ Flow
Flow Logic)
Logic)
2.
2. ABAP/4
ABAP/4 Program
Program

We will design
design screens using
using Screen
Screen Painter.
Painter.
Flow
Flow logic
logic contains following
following set
set of
of events.
events.
3.
3. PBO
PBO –– Process
Process Before
Before output
output Event
Event
4.
4. PAI
PAI –– Process
Process After
After Input
Input Events in Module pool programming
5.
5. POV
POV –– Process
Process On
On Value
Value Request
Request
6.
6. POH – Process on Help Request
POH – Process on Help Request

Business logic written ABAP/4 program in processing blocks so called MODULEs. These
Modules will
will be called by
by screen
screen flow
flow logic
logic

Workbench
Workbench Transactions:
Transactions:
SE51
SE51 -- Screen
Screen Painter
Painter
SE41
SE41 –– GUI
GUI Status
Status
SE38
SE38 – ABAP Program
– ABAP Program
SE93 – Transaction
SE93 – Transaction
OR
SE80
SE80 –– Object
Object Navigator
Navigator
Example:
Example: ME21N,
ME21N, ME21,
ME21, VA01
VA01 etc..
etc..

4
Module pool Programming – Events

EVENTS
EVENTS IN
IN MPP:

1. PROCESS BEFORE OUTPUT


2. PROCESS AFTER
AFTER INPUT
INPUT
3. PROCESS ON VALUE REQUEST
4. PROCESS ON HELP REQUEST

PROCESS
PROCESS BEFORE
BEFORE OUTPUT -
OUTPUT -

This
This event gets triggered whenever the program is executed using
using Tcode. This
This event
event is
is used
used to
to assign
assign initial
initial default values to the
screen
screen components.
components.

PROCESS
PROCESS AFTER
AFTER INPUT
INPUT ––
  
This
This event gets triggered after some user's action in
user's action in the
the screen
screen (for eg, after clicking pushbutton, subsequent event functionalities).

PROCESS
PROCESS ONON VALUE
VALUE REQUEST
REQUEST ––
  
This
This event is used to assign F1 functionality for the screen
screen components.

PROCESS
PROCESS ONON HELP REQUEST
REQUEST -
  
This
This event is used to assign F4 functionality for the input
input field
field in the screen.
5
Module pool Programming –Screen Painter
Screen Painter: SE51
Flow
Flow Logic:
This
This is
is the place where we call
call ABAP
ABAP Logic.
Logic.
ABAP logic will
will be
be written in processing
processing Blocks
Blocks so
so called
called
MODULES
MODULES

Element List:
Properties of
of all
all of
of UI elements
elements which
which are
are added
added in
in screen
screen

Attributes:
Screen Attributes includes Description, Type of screen, Next
Next
screen To
To be
be displayed
displayed etc.
etc.

Layout Editor:
It is the place where we Actually place the UI elements. It is a
Container of various
various UI
UI elements.
elements. We Can link
link UI
UI elements
elements
with ABAP/4 Data objects by providing same name to it

6
Module pool Programming -Screen Painter

Screen Type:
Type: It specifies the screen type
Normal:
General screen type

Sub screen:
To display screen in another
another Screen with help
help of
of sub
screen area

Modal Dialog Box: to display screen as


Pop up dialog

Selection Screen:
Screen:
To display selection Screen on module pool

Next Screen:
We have to specify screen number to
Navigate from one screen to other screen When
processing completed in
in previous
previous screen

7
Module pool Programming –Screen Painter
Layout Editor: Screen Container

We can drag and drop UI elements


From the left side window onto the
Screen
Screen UI
UI container
container

Each UI element identified by the name. we will provide


same name as
ABAP/4
ABAP/4 Name

Function Keys
Keys Used:
Used:

F7- Element list window

F6- Dictionary/Program
Dictionary/Program fields
fields window
window

F2 – Attributes window

8
Module pool Programming –Screen Painter

9
Module pool Programming –Screen Painter

10
Module pool Programming –Screen Painter
UI
UI Elements
Elements list
list and
and properties
properties includes
includes technical
technical Properties
Properties and
and Display
Display Properties
Properties

11
Module pool Programming –Screen Painter
Screen Painter: Flow Logic

12
Module pool Programming –Screen Painter
Screen
Screen flow
flow logic
logic calls modules which are implemented
implemented in
in ABAP/4
ABAP/4 Program
Program

13
Module pool Programming – Events

14
Module pool Programming – Simple UI Elements
Simple UI elements

Text Field: ItIt is


is for
for providing
providing labels
labels for
for input
input fields
fields

Input Field: it is for accepting user input. We can make input


input field
field as
as drop
drop down
down box
box as
as well
well

Checkbox: check box will accept


accept user input
input as
as checked or unchecked

Radio Button:
Button: itit is used
used to
to select only one option for group of options. We can assign
function code to the radio button group for automatic triggering of PAI event. Function
code will
will be captured in SY-UCOMM field

Push Button:
Button: Special
Special input
input UI
UI element.
element. We
We will
will assign
assign function
function code
code for
for buttons. Whenever
Whenever
User clicked on this button,
button, function code will
will be
be captured
captured in
in system field
field SY-UCOMM. we
can handle this
this function
function code
code in our
our program
program

15
Module pool Programming –Input validation
Input Validation:
Input Validation:
we will use syntax FIELD <Field_Name> MODULE <Module_Name> to validate values in the Field
we<Field_Name>
will use syntaxinFIELD <Field_Name>
the module MODULE <Module_Name> to validate values in the Field
<Module_Name>
<Field_Name> in the module <Module_Name>

16
Module pool Programming – Input Validation

CHAIN
CHAIN & ENDCHAIN
ENDCHAIN

ItIt is
is used
used to
to validate
validate group
group of
of screen
screen fields
fields

Whenever
Whenever error message raised in the Module pool, except the input field for which we
have
have entered value, all other fields will be disabled for input. System will not allow to
enter
enter the
the value
value

To
To avoid this
this situation
situation we
we have
have to
to enclose
enclose list
list of fields
fields which
which should
should be ready
ready for
for user
user
input
input in
in the
the CHAIN
CHAIN and ENDCHAIN
ENDCHAIN asas below
below

CHAIN.
CHAIN.
Field
Field WA_MARD-MATNR.
WA_MARD-MATNR.
Field
Field WA_MARD-WERKS
WA_MARD-WERKS
module
module VALIDATE_INPUT.
VALIDATE_INPUT.
ENDCHAIN.
ENDCHAIN.

17
Module pool Programming – Input validation

18
Module pool Programming – Navigation
Based on complexity we will design one more screens. We can navigate from one screen to
Based on complexity
another we will
screen in two waysdesign one more screens. We can navigate from one screen to
another screen in two ways
1. Static Navigation
1. 2.Static Navigation
Dynamic Navigation
2. Dynamic Navigation
Static Navigation: In the screen attributes, we will specify the next screen number that has to be
Static onceInprocessing
Navigation:
displayed the screendone
attributes,
in the we will specify
current screen the next screen number that has to be
displayed once processing done in the current screen
Dynamic Navigation: with the help of following statements, we will navigate from one screen
Dynamic Navigation:
To another screen.with the help of following statements, we will navigate from one screen
To another screen.
3. SET SCREEN <Screen Number>
3. 4. SETCALL
SCREEN <Screen
SCREEN Number>
<Screen Number>
4. 5. CALL SCREEN <Screen Number>
SET SCREEN <Screen Number> LEAVE SCREEN
5. 6. SETLEAVE
SCREEN
TO <Screen
SCREEN Number> LEAVE SCREEN
<Screen Number>
6. LEAVE TO SCREEN <Screen Number>

19
Module pool Programming – Navigation
SET SCREEN <Screen Number>:
SETThis
SCREEN <Screendynamically
command Number>: calls the next screen by Executing the current screen. i.e. by
This command
executing thedynamically
PAI modulecalls thecurrent
of the next screen by Executing the current screen. i.e. by
screen.
executing the PAI module of the current screen.
To come back to the main screen, we have to provide the push button onto the next Screen
To with
comeitsback to the main
respective code screen,
in it. we have to provide the push button onto the next Screen
with its respective code in it.

20
Module pool Programming – Navigation

21
Module pool Programming – Navigation
CALL SCREEN <Screen Number>:
CALL SCREEN
This <Screen
statement Number>:
calls a pop up screen called as model dialog box from the first screen
This statement
without calls athe
executing popcurrent
up screen called
screen. i.e.asitsmodel dialog box from the first screen
PAI module.
without executing the current screen. i.e. its PAI module.

22
Module pool Programming – Navigation
CALL SCREEN <Screen Number>:
CALL SCREEN <Screen Number>:
Note:
Note:
To make the pop up screen as model dialog box, we have to select the screen type as
To Model
make the popbox
Dialog up screen as screen
and next model as
dialog
‘0’. box, we have to select the screen type as
Model Dialog box and next screen as ‘0’.
To comeback to the main screen, you no need to
To Explicitly
comebackprovide
to the the
main screen,
push youon
button nothe
need
poptoup screen with its respective code. But just
Explicitly provide
Hit enter the push
will bring button
you back on the
to the mainpop up screen with its respective code. But just
screen
Hit enter will bring you back to the main screen

23
Module pool Programming – Navigation
LEAVE TO SCREEN <Screen Number> OR
LEAVE
SET TO SCREEN
SCREEN <Screen
<Screen Number>
Number> OR SCREEN
LEAVE
SET SCREEN <Screen Number> LEAVE SCREEN
This command call the next screen dynamically without executing the current screen that is
This
itscommand call the next screen dynamically without executing the current screen that is
PAI Module
its PAI Module
To comeback to the main screen from the next screen you need to explicitly provide the
To push
comeback
buttontowith
the main screen from
its respective codethe nextnext
in the screen you need to explicitly provide the
screen
push button with its respective code in the next screen

Back and Exit Buttons


Back
To and Exit Buttons
go back to previous screen, we will use
To go back
1. toLEAVE
previous screen,
TO SCREEN we will use OR
<Prev_Screen>
1. 2. LEAVE
SET TO SCREEN
SCREEN <Prev_Screen>
<prev_screen> OR SCREEN
LEAVE
2. SET SCREEN <prev_screen> LEAVE SCREEN
Above commands will close screen sequence
Above commands will close screen sequence
If we want to exit completely then use
If we want to exit
LEAVE completely
TO SCREEN 0 then use
LEAVE TO SCREEN 0

24
Module pool Programming – Complex UI Elements

Complex UI Elements
Complex1.UI Elements
Sub screen
1. 2. SubTable
screen
2. 3. Table
Tab Strips
3. Tab Strips

25
Module pool Programming – Complex UI Elements: Sub Screen

Sub screen is a screen with in a screen


Sub screen is a screen with in a screen
Steps:
Steps:
1. Create a main screen as a normal screen and provide the sub screen area onto it and
1. Create
namea itmain screen as a normal screen and provide the sub screen area onto it and
2.name it another screen as type sub screen
Create
2. 3.Create another
Arrange screen
the fields onasthe
type
subsub screen
screen such that they should fit the sub screen area
3. 4.Arrange the fields on the sub screen such that they should fit the sub screen area
Call the sub screen in the screen flow logic
4. Call the sub screen in the screen flow logic

26
Module pool Programming – Complex UI Elements: Sub Screen

27
Module pool Programming – Complex UI Elements: Sub Screen

Drag & Drop Sub screen area on to the Screen


Drag & Drop
Provide Sub to
name screen areascreen
the Sub on to area
the Screen
Provide name
Add logic into thelogic
Flow Sub screen area
to dynamically place the other screen in
Add logic in Flow logic
the sub screen area to dynamically place the other screen in
the sub screen
PBO: area
CALLPBO:
SUBSCREEN <name> INLCLUDING <prog_name>
CALL SUBSCREEN <name> INLCLUDING <prog_name>
<screen_Number>
<screen_Number>
PAI:
PAI:CALL SUBSCREEN <name> Screen type should be
CALL SUBSCREEN <name> Screen type
Sub should
Screen be
Screen <Screen_Number> should be sub scree type Sub Screen
Screen <Screen_Number> should be sub scree type
28
Module pool Programming – Complex UI Elements: Table control
Table control is a screen table which displays multiple records on to it. Table control act
Table
as acontrol is a screen
loop when code istable which
written displays multiple records on to it. Table control act
to it.
as a loop when code is written to it.
Table Control in left navigation
Table
paneControl in left
in screen navigation
editor
pane in screen editor

Drag and drop the table control on to the Screen container, Name it and add the fields on
Drag andtable
to the drop control
the table control on to the Screen container, Name it and add the fields on
to the table control

29
Module pool Programming – Complex UI Elements: Table control

Declare table control variable in the main program as follows


Declare table control variable in the main program as follows
Syntax:
Syntax: CONTROLS <table name> TYPE TABLEVIEW USING SCREEN <Screen Number>
CONTROLS <table name> TYPE TABLEVIEW USING SCREEN <Screen Number>

Logic to populate records in table control in PBO Events


Logic to populate records inTable>
LOOP AT <Internal table control in PBO
INTO <work Events
area> WITH CONTROL <control Name>
LOOP AT <Internal Table> INTO <work area> WITH CONTROL <control Name>
ENDLOOP
ENDLOOP
Logic to get modified records from table control in PAI Events
Logic to get modified
LOOP records
AT <Internal from table control in PAI Events
Table>.
LOOP AT <Internal Table>.
ENDLOOP
ENDLOOP

30
Module pool Programming – Complex UI Elements - Table Control

31
Module pool Programming – Complex UI Elements - Table Control

Making columns enable or disable in the table


Making columns enable or disable in the table
control:
control:
we can loop table control in the PBO Event
weand
canchange
loop table controlof
properties in each
the PBO
andEvent
every
and change
column properties of each and every
column

32
Module pool Programming – Complex UI Elements - Tabstrip
Tabstrip control displays
displays several
several screens
screens and on selecting each
each tab
tab associated
associated screen
screen will
will
be displayed

We
We have
have three tabs
tabs in the screen. by
default
default any
any one
one of
of the tab
tab will
will be selected.

Sub screen
screen has
has to
to be
be
included each tab to
display another screen
screen

Each tab having


having its own
own name
name and
and
function code attached to it

33
Module pool Programming – Complex UI Elements - Tabstrip

34
Module pool Programming – Complex UI Elements - Tabstrip

Flow
Flow Logic:
Logic:
If we add the separate sub screen in each tab
then we have to call all the sub screens in the
PBO and PAI

PAI
PAI Logic:
Logic:
Whenever we select the tab then We
have to activate the tab by setting the tab
name to it as below

<tab
<tab strip
strip name>-ACTIVETAB
name>-ACTIVETAB == <tab
<tab name>
name>

35
Module pool Programming – Complex UI Elements - Tabstrip

Flow
Flow Logic:
Logic:
IfIf we
we add
add the
the single
single sub screen for all the tabs
then
then we we have
have toto call
call only
only one sub
sub screens
screens in the
the
PBO
PBO and PAI PAI

PAI
PAI Logic:
Logic:
Whenever
Whenever we selectselect the
the tab
tab then
then We
We
have
have to activate the tabtab and need to call
associate
associate screen
screen by
by setting
setting the tab
tab name
name
to
to itit as below
below

<tab
<tab strip
strip name>-ACTIVETAB
name>-ACTIVETAB == <tab
<tab name>
name>
G_screen
G_screen == <Screen
<Screen Number>
Number>

36

You might also like