08.abap dialog programming overview
DESCRIPTION
This document shows the overview about SAP ABAP Dialog programming.TRANSCRIPT
![Page 1: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/1.jpg)
Dialog Programming Overview
![Page 2: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/2.jpg)
SAP System : Dialog Processing (Report)
Database Server
Application Server
Dispatcher
RequestQueue
D D D D…
SAP Buffer
Program
…
…
1
3
45
68
9
10
Report zpsm1.
Tables customers.
Select single * from
customers where id = 1.
Write: / customers-name.
Execute ABAP statement
Check Program in Program Buffer
7
Load&Gen Program
SQL Request
Send List
Generate Screen(List)Send Request
Request List
2 Search for free WP
Store request to queue
Send request to WP
SAP GUI
![Page 3: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/3.jpg)
Dialog WP : Executable ProgramDialog WP : Executable ProgramDialog WP
TaskHandler
DYNPRO Processor
ABAP Processor
Database
Local Memory
Memory Space
DB Interface
List Buffer
Result Set Memory
![Page 4: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/4.jpg)
Types of ABAP Report
1. Report Listing
2. Drill-down Report
3. Control-break Report
4. ALV Report
1
3
4
![Page 5: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/5.jpg)
SAP System : Dialog Processing (DIALOG)
Database Server
Application Server
Dispatcher
RequestQueue
D D D D…
SAP Buffer
Program
…
…
1
3
45
68
9
10
Program sapmzex001.
Include ….
Set screen 100.
…
Execute ABAP statement
Check Program in Program Buffer
7
Load&Gen Program
SQL Request
Send List
Generate Dialog ScreenSend Request
Request Screen
2 Search for free WP
Store request to queue
Send request to WP
SAP GUI
![Page 6: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/6.jpg)
Dialog WP : Dialog ProgramDialog WP : Dialog ProgramDialog WP
TaskHandler
DYNPRO Processor
ABAP Processor
Database
Local Memory
ABAP Memory
DB Interface
Screen Buffer
Result Set Memory
![Page 7: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/7.jpg)
Dialog Program : Transaction
![Page 8: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/8.jpg)
Dialog Program ComponentsTransaction Code
Transaction Code
Screen : 100100(Screen Layout)
Screen : 200200(Screen Layout)
Flow Logic
Flow Logic
PBO
PAI
ABAP Module Pool
ABAP Module Pool
PBO
PAI
ABAP Module Pool
ABAP Module Pool
Dialog ProgramDialog Program Program Naming Convention : SAPM…
![Page 9: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/9.jpg)
SAP Transaction
An SAP transaction consists of Dialog steps. A Dialog step begins when the user press Enter,activates a function by pressing a function key,double-clicks or chooses a function from a menu.It ends when the next screen is display
In the course of a Dialog step,The PAI modules belonging to the current screen and the PBO modules belonging to the next screen
DB Commit DB Commit
![Page 10: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/10.jpg)
Data Transfer (Local Memory)
Screen BufferABAP Memory Space
Screen Work Area ABAP Work Area
PBOPBO
PAIPAI
customers-id
customers-name
customers
id name city … 0000000
ok_code
ok_code
Local Memory
Element List
![Page 11: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/11.jpg)
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.
Process After Input(PAI) Before it processes the first module in the PAI
processing block, the system copies the contents of the fields in the screen work area to their corresponding fields in the ABAP work area.
![Page 12: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/12.jpg)
OK Code Field in Screen
OK Code Field orCommand Field
(ok_code in Element List)
![Page 13: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/13.jpg)
Defining Screen (4 Steps) Screen Attribute Screen Layout Flow Logic Element List
Element List(ok_code
field)
![Page 14: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/14.jpg)
Flow Logic in Screen 100
PROCESS BEFORE OUTPUT.MODULE STATUS_0100.
PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
![Page 15: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/15.jpg)
PBO in Screen 100
MODULE status_0100 OUTPUT.SET PF-STATUS ‘0100’.
SET TITLEBAR ‘0100’.ENDMODULE.
![Page 16: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/16.jpg)
PAI in Screen 100MODULE user_command_0100 INPUT.
CASE ok_code. WHEN ‘EXIT’. “Leave
program SET SCREEN 0. LEAVE SCREEN. “Leave to
screen 0 WHEN ‘SAVE’. UPDATE customers. MESSAGE S000(38) WITH ‘Update OK’. SET SCREEN 50. LEAVE SCREEN. ENDCASE.ENDMODULE.
![Page 17: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/17.jpg)
How to Create Dialog Program Transaction SE80 : Create Dialog
Program Create Screen(4 steps)
Screen Attribute Screen Layout Flow Logic(PBO,PAI) Define Variable ok_code in Element
List Define Data Object in ABAP Work Area
at TOP Include(Tables, Data,...) Check and Activate Dialog Program Create Transaction Code
![Page 18: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/18.jpg)
Example I
Maintain Customers Data
Screen : 100 Screen : 200
![Page 19: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/19.jpg)
Example I
Create Dialog Program SAPMZEX<nn> for changing Customers table Screen 100
Field customers-id Screen 200
Field customers-id and customers-name
![Page 20: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/20.jpg)
Example I
Screen 100
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
![Page 21: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/21.jpg)
Example I
Screen 100
MODULE status_0100 OUTPUT. SET PF-STATUS ‘0100’. SET TITLEBAR ‘0100’.
ENDMODULE.
![Page 22: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/22.jpg)
Example I
Screen 100MODULE 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.
![Page 23: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/23.jpg)
Example I
Screen 200
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
PROCESS AFTER INPUT. MODULE USER_COMMAND_0200.
![Page 24: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/24.jpg)
Example I
Screen 200
MODULE status_0200 OUTPUT. SET PF-STATUS ‘0200’. SET TITLEBAR ‘0200’.
ENDMODULE.
![Page 25: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/25.jpg)
Example I Screen 200
MODULE user_command_0200 INPUT. CASE ok_code. WHEN ‘BACK’. LEAVE TO SCREEN 100. “set screen 100 WHEN ‘SAVE’. UPDATE customers. MESSAGE S000(38) WITH ‘Update OK!’. LEAVE TO SCREEN 100. ENDCASE. ENDMODULE.
![Page 26: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/26.jpg)
Example I
TOP IncludeTABLES customers.DATA ok_code TYPE sy-ucomm. Create Transaction CodeTransaction Code : ZEX<nn>
![Page 27: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/27.jpg)
Exercise
Create Dialog Program : SAPMZCUST<nn>
Transaction Code : ZCUST<nn>
![Page 28: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/28.jpg)
Exercise : Customers Maintenance
Screen : 100 Screen : 200
![Page 29: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/29.jpg)
Setting the Cursor Position Dynamically
Cursor Position
PROCESS BEFORE OUTPUT. MODULE STATUS_0200. MODULE set_cursor.
MODULE set_cursor OUTPUT. SET CURSOR FIELD ‘CUSTOMERS-CITY’ OFFSET 3. ENDMODULE.
![Page 30: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/30.jpg)
Avoiding the Unexpected Processing Step of ok_code
Field
![Page 31: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/31.jpg)
1. Auxiliary OK_CODE Variable
TOP IncludeTABLES customers.DATA ok_code TYPE sy-ucomm.DATA save_ok TYPE sy-ucomm.
![Page 32: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/32.jpg)
Example I - Change
Screen 100 : PAIMODULE user_command_0100 INPUT.
save_ok = ok_code. CLEAR ok_code. CASE save_ok. WHEN ‘BACK’. LEAVE PROGRAM. WHEN space. SELECT SINGLE * FROM customers WHERE id = customers-
id. LEAVE TO SCREEN 200. ENDCASE.
ENDMODULE.
![Page 33: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/33.jpg)
Example I - Change Screen 200 : PAI
MODULE user_command_0200 INPUT. save_ok = ok_code. CLEAR ok_code. CASE save_ok. WHEN ‘BACK’. LEAVE TO SCREEN 100. WHEN space. LEAVE TO SCREEN 200. WHEN ‘SAVE’. UPDATE customers. MESSAGE s000(38) WITH ‘Update OK!’. LEAVE TO SCREEN 100. ENDCASE.
ENDMODULE.
![Page 34: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/34.jpg)
2. Specify the Enter Function at GUI Status
![Page 35: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/35.jpg)
Check Enter Function
Screen 100 : PAIMODULE user_command_0100 INPUT.
CASE ok_code. WHEN ‘BACK’. LEAVE PROGRAM. WHEN ‘ENTE’. SELECT SINGLE * FROM customers WHERE id = customers-id. LEAVE TO SCREEN 200. ENDCASE.
ENDMODULE.
![Page 36: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/36.jpg)
3. Clear OK_CODE at PBO
Screen 100 : Flow Logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100. MODULE clear_ok_code.
PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
![Page 37: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/37.jpg)
Clear OK_CODE at PBO
Screen 100 : PBOMODULE status_0100 OUTPUT.
SET PF-STATUS ‘0100’. SET TITLEBAR ‘0100’.
ENDMODULE.
MODULE clear_ok_code OUTPUT. CLEAR ok_code. ENDMODULE.
![Page 38: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/38.jpg)
Checking User Input
![Page 39: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/39.jpg)
Example II
Maintain Customers Data Check Input Data ManuallyCheck Input Data Manually
![Page 40: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/40.jpg)
Example II Screen 100 : PAI
MODULE user_command_0100 INPUT. ... WHEN SPACE. SELECT SINGLE * FROM customers WHERE id = customers-id. IF sy-subrc <> 0. MESSAGE S000(38) WITH ‘Customers data not found’. LEAVE TO SCREEN 100. ELSE. LEAVE TO SCREEN 200. ENDIF. ENDCASE.
ENDMODULE.
![Page 41: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/41.jpg)
Example III
Maintain Customers Data Check Input Data Using Check Input Data Using FieldField CommandCommand
![Page 42: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/42.jpg)
Example III – Field Statement
Screen 100 : Flow Logic (PAI)
PROCESS AFTER INPUT.
FIELD customers-id MODULE user_command_0100.
![Page 43: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/43.jpg)
Example III
Screen 100 : PAIMODULE user_command_0100 INPUT.
... WHEN SPACE. SELECT SINGLE * FROM customers WHERE id = customers-id. IF sy-subrc <> 0. MESSAGE E000(38) WITH ‘Customers data not found’. ELSE. LEAVE TO SCREEN 200. ENDIF. ENDCASE.
ENDMODULE.
![Page 44: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/44.jpg)
Field Input Checking If you want to check input values in the
module pool and start dialog in the event of a negative result,you use the FIELD statement with the addition MODULE.
If the module results in an error(E) or warning(W) message,the screen is redisplayed without processing the PBO modules.The message text is displayed and only the field being checked by this module becomes ready for input again
![Page 45: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/45.jpg)
Field Statement With More Than 1 Field
Screen 100 : Flow Logic (PAI)PROCESS AFTER INPUT.
CHAIN.
FIELD: customers-id,customers-custtype MODULE user_command_0100.
ENDCHAIN.
PROCESS AFTER INPUT. CHAIN. FIELD customers-id MODULE user_command_0100. FIELD customers-custtype MODULE user_command_0100. ENDCHAIN.
![Page 46: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/46.jpg)
Field Statement & Data Transport
PROCESS AFTER INPUT. MODULE a. FILED f1 MODULE b. FILED f2 MODULE c. MODULE d.
f1 f2
f3 f4
Screen 100
•Transfer f3,f4•Call module a•Transfer f1•Call module b•Transfer f2•Call module c•Call module d
![Page 47: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/47.jpg)
Required Field
![Page 48: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/48.jpg)
Required Field
![Page 49: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/49.jpg)
Required Field
![Page 50: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/50.jpg)
At exit-command
![Page 51: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/51.jpg)
Function Type : Exit Command
![Page 52: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/52.jpg)
When user chooses a function with type E,the screen flow logic jumps directly to the following statement
MODULE <module> AT EXIT-MODULE <module> AT EXIT-COMMANDCOMMAND
No other screen fields are transported to the program except OK Code field
At exit-command
![Page 53: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/53.jpg)
At exit-command
Screen 100 : Flow Logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT. MODULE exit AT EXIT-COMMAND. MODULE USER_COMMAND_0100.
![Page 54: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/54.jpg)
At exit-command
Screen 100 : PAI
MODULE exit INPUT. CASE ok_code. WHEN ‘EXIT’. LEAVE PROGRAM. ENDCASE.
ENDMODULE.
LEAVE PROGRAM.
![Page 55: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/55.jpg)
Function Module (POPUP_TO_CONFIRM_LOSS_OF_DAT
A)
![Page 56: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/56.jpg)
Example IV
Maintain Customer Data Popup confirmation data using Popup confirmation data using function function ‘ ‘POPUP_TO_CONFIRM_LOSS_OF_DATA’
![Page 57: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/57.jpg)
Example IV
TOP Include...
DATA ans.
![Page 58: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/58.jpg)
Example IV
Screen 100 : PAIMODULE exit INPUT.
CALL FUNCTION ‘POPUP_TO_CONFIRM_LOSS_OF_DATA’ EXPORTING textline1 = ‘Are you sure?’ titel = ‘Please Confirm!!!’ IMPORTING answer = ans. IF ans = ‘J’. “J = Ja in German= Yes in English LEAVE PROGRAM. ELSE. ENDIF. ENDMODULE.
![Page 59: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/59.jpg)
SAP Transaction : Enqueue Lock Object
![Page 60: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/60.jpg)
SAP Transaction & DB Transaction
Each Dialog step can contain update requests(INSERT,DELETE,UPDATE)
After each Dialog step,the R/3 system automatically passes a database commit to the database system.The database system then distributes the update requests from the individual dialog steps across several database transactions
A rollback in one Dialog step has no effect on database updates performed in previous Dialog steps
![Page 61: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/61.jpg)
SAP Transaction(LUW)DB Commit DB Commit
SAP LUW
DB LUW
![Page 62: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/62.jpg)
SAP Database Maintenance Steps
Check data locking by calling function ‘ENQUEUE_<lock objectlock object>’
Read data from Database Ex. Select single …
Data Processing Ex. Update ... Release lock by calling function
‘DEQUEUE_<lock objectlock object>’
![Page 63: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/63.jpg)
SAP Lock Object
Transaction SE11 : Lock object ENQUEUE_<lock objectlock object> DEQUEUE_<lock objectlock object>
![Page 64: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/64.jpg)
SAP Lock Object : Function Module
![Page 65: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/65.jpg)
Example IV
ENQUEUE /DEQUEUELock Object(SE11)CALL FUNCTION ‘ENQUEUE_EZCUST<nn>’ CALL FUNCTION ‘DEQUEUE_EZCUST<nn>’
User 1 User 2
![Page 66: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/66.jpg)
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.
...
![Page 67: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/67.jpg)
Example IV (II) Screen 100 : PAI
MODULE user_command_0100 INPUT. ... WHEN SPACE. CALL FUNCTION ‘ENQUEUE_EZCUST00’ EXPORTING id = customers-id ... IF sy-subrc <> 0. CONCATENATE ‘Data was locked by :’ sy-msgv1 INTO
mess. MESSAGE E000(38) WITH mess. ELSE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
...
message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
![Page 68: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/68.jpg)
Example IV Screen 200 : PAI
MODULE user_command_0200 INPUT. ... WHEN ‘BACK’. CALL FUNCTION ‘DEQUEUE_EZCUST00’ EXPORTING … id = customers-id. LEAVE TO SCREEN 100. …
![Page 69: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/69.jpg)
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. ... ...
![Page 70: 08.ABAP Dialog Programming Overview](https://reader034.vdocuments.us/reader034/viewer/2022042519/55cf996d550346d0339d5686/html5/thumbnails/70.jpg)
Monitoring Enqueue Lock : SM12