Dialog Programming
Dialog 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.
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:
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
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
Function Keys
Keys Used:
Used:
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
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
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
26
Module pool Programming – Complex UI Elements: Sub Screen
27
Module pool Programming – Complex UI Elements: Sub Screen
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
30
Module pool Programming – Complex UI Elements - Table Control
31
Module pool Programming – Complex UI Elements - Table Control
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
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