08.ABAP Dialog Programming Overview
08.ABAP Dialog Programming Overview
Report zpsm1.
Request Tables customers.
List Select single * from
Generate
1 customers where id = 1.
Screen(List)
10
Application Server Send Request Write: / customers-name.
Store request to
queue 3 Dispatcher
Send List 2 Search for SAP Buffer
9 free WP
Request Check Program in 7
Program
Queue Send request to Program
5 Buffer Execute
WP4 ABAP
…
statemen
D D D … D t
…
8 6
SQL Load&Gen
Database Server Request Program
Dialog WP : Executable Program
Dialog WP Local Memory
ABAP Processor
DYNPRO Processor
List Buffer
DB Interface
Result Set Memory
Database
Types of ABAP Report
1. Report Listing
4 2. Drill-down Report
3. Control-break Report
4. ALV Report
SAP System : Dialog Processing (DIALOG)
SAP GUI
Program sapmzex001.
Request Include ….
Screen Set screen 100.
Generate Dialog
1 …
Screen
10
Application Server Send Request
Store request to
queue 3 Dispatcher
Send List 2 Search for SAP Buffer
9 free WP
Request Check Program in 7
Program
Queue Send request to Program
5 Buffer Execute
WP4 ABAP
…
statemen
D D D … D t
…
8 6
SQL Load&Gen
Database Server Request Program
Dialog WP : Dialog Program
Dialog WP Local Memory
ABAP Memory
TaskHandler
ABAP Processor
DYNPRO Processor
Screen Buffer
DB Interface
Result Set Memory
Database
Dialog Program : Transaction
Dialog Program Components
Transaction Code
Screen Buffer
ABAP Memory Space
PBO
Element List
customers
id name city …
customers-id 0000000
customers-name
ok_code
PAI
Flow Logic
Process Before Output(PBO)
After it has processed all of the modules in the
PBO processing block, the system copies the
contents of the fields in the ABAP work area to
their corresponding fields in the screen work area.
OK Code Field or
Command Field
(ok_code in Element List)
Defining Screen (4 Steps)
Screen Attribute
Screen Layout
Flow Logic Element
List(ok_code field)
Element List
Flow Logic in Screen 100
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
Screen Layout
Flow Logic(PBO,PAI)
Field customers-id
Screen 200
f3 f4
Required Field
Required Field
Required Field
At exit-command
Function Type : Exit Command
At exit-command
When user chooses a function with type
E,the screen flow logic jumps directly to the
following statement
MODULE <module> AT EXIT-COMMAND
No other screen fields are transported to the
program except OK Code field
At exit-command
Screen 100 : Flow Logic
DB LUW
SAP LUW
SAP Database Maintenance Steps
Check data locking by calling function
‘ENQUEUE_<lock object>’
Read data from Database Ex. Select single …
Data Processing Ex. Update ...
Release lock by calling function
‘DEQUEUE_<lock object>’
SAP Lock Object
Transaction SE11 : Lock object
ENQUEUE_<lock object>
DEQUEUE_<lock object>
SAP Lock Object : Function Module
Example IV
ENQUEUE /DEQUEUELock Object(SE11)
CALL FUNCTION ‘ENQUEUE_EZCUST<nn>’
CALL FUNCTION ‘DEQUEUE_EZCUST<nn>’
User 1 User 2
Example IV (I)
Screen 100 : PAI
MODULE user_command_0100 INPUT.
...
WHEN SPACE.
CALL FUNCTION ‘ENQUEUE_EZCUST00’
EXPORTING
…
id = customers-id
EXCEPTIONS
...
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
...
Example IV (II)
Screen 100 : PAI
MODULE user_command_0100 INPUT.
...
WHEN SPACE.
CALL FUNCTION ‘ENQUEUE_EZCUST00’
EXPORTING message id sy-msgid type sy-
id = customers-id msgty number
... sy-msgno with sy-
IF sy-subrc <> 0. msgv1 sy-msgv2
CONCATENATE ‘Data was locked by :’ sy-msgv1 INTO mess.
sy-msgv3 sy-msgv4.
MESSAGE E000(38) WITH mess.
ELSE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
...
Example IV
Screen 200 : PAI
MODULE user_command_0200 INPUT.
...
WHEN ‘BACK’.
CALL FUNCTION ‘DEQUEUE_EZCUST00’
EXPORTING
…
id = customers-id.
LEAVE TO SCREEN 100.
…
Example IV
Screen 200 : PAI
MODULE user_command_0200 INPUT.
...
WHEN ‘SAVE’.
UPDATE customers.
MESSAGE S000(38) WITH ‘Update OK!’.
CALL FUNCTION ‘DEQUEUE_EZCUST00’
EXPORTING
…
id = customers-id.
LEAVE TO SCREEN 100.
...
...
Monitoring Enqueue Lock : SM12