Professional Documents
Culture Documents
08.ABAP Dialog Programming Overview
08.ABAP Dialog Programming Overview
Request
Tables customers.
List
Application Server
Send Request
Generate Screen(List)
customers where id = 1.
10
Write: / customers-name.
Dispatcher
Send List
Request
Queue Send request to WP
SAP Buffer
Program
Database Server
SQL Request
Load&Gen Program
Execute ABAP
statement
Local Memory
TaskHandler
Memory Space
ABAP Processor
DYNPRO Processor
DB Interface
Result Set Memory
Database
List Buffer
1. Report Listing
2. Drill-down Report
3. Control-break Report
4. ALV Report
Request
Include .
Screen
Application Server
Send Request
10
Dispatcher
Send List
Request
Queue Send request to WP
SAP Buffer
Program
Database Server
SQL Request
Load&Gen Program
Execute ABAP
statement
Local Memory
TaskHandler
ABAP Memory
ABAP Processor
DYNPRO Processor
DB Interface
Result Set Memory
Database
Screen Buffer
Dialog Program
Screen : 100
(Screen Layout)
PAI
Flow Logic
Screen : 200
(Screen Layout)
PBO
PBO
PAI
Flow Logic
SAP Transaction
DB Commit
DB Commit
ok_code
Screen Buffer
PBO
Element List
customers
id
customers-id
customers-name
name
0000000
PAI
ok_code
city
Flow Logic
Screen Attribute
Screen Layout
Flow Logic
Element List
Example I
Maintain Customers Data
Screen : 100
Screen : 200
Example I
Example I
Screen 100
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
Example I
Screen 100
MODULE status_0100 OUTPUT.
SET PF-STATUS 0100.
SET TITLEBAR 0100.
ENDMODULE.
Example I
Screen 100
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN BACK.
LEAVE PROGRAM. leave to screen 0
WHEN space. if not assign Enter Key
SELECT SINGLE * FROM customers
WHERE id = customers-id.
LEAVE TO SCREEN 200.
ENDCASE.
ENDMODULE.
Example I
Screen 200
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0200.
Example I
Screen 200
MODULE status_0200 OUTPUT.
SET PF-STATUS 0200.
SET TITLEBAR 0200.
ENDMODULE.
Example I
Screen 200
Example I
TOP Include
TABLES customers.
DATA ok_code TYPE sy-ucomm.
Exercise
Create Dialog Program : SAPMZCUST<nn>
Transaction Code : ZCUST<nn>
Screen : 200
Cursor Position
TOP Include
TABLES customers.
DATA ok_code TYPE sy-ucomm.
DATA save_ok TYPE sy-ucomm.
Example I - Change
Example I - Change
ENDMODULE.
ENDMODULE.
Example II
Maintain Customers Data
Example II
Example III
Maintain Customers Data
Example III
f2
f4
Transfer f3,f4
Call module a
Transfer f1
Call module b
Transfer f2
Call module c
Call module d
Required Field
Required Field
Required Field
At exit-command
At exit-command
At exit-command
At exit-command
LEAVE PROGRAM.
Function Module
(POPUP_TO_CONFIRM_LOSS_OF_DATA)
Example IV
Maintain Customer Data
Example IV
TOP Include
...
DATA ans.
Example IV
ENDMODULE.
SAP Transaction(LUW)
DB Commit
DB LUW
SAP LUW
DB Commit
ENQUEUE_<lock object>
DEQUEUE_<lock object>
Example IV
User 1
User 2
Example IV (I)
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)
Example IV
id = customers-id.
LEAVE TO SCREEN 100.
Example IV
id = customers-id.
LEAVE TO SCREEN 100.
...
...