Presentation is loading. Please wait.

Presentation is loading. Please wait.

User Dialog Overview. Update Statement TABLES customers. SELECT SINGLE * FROM customers WHERE id = 1. IF sy-subrc = 0. customers-name = ‘John’. UPDATE.

Similar presentations


Presentation on theme: "User Dialog Overview. Update Statement TABLES customers. SELECT SINGLE * FROM customers WHERE id = 1. IF sy-subrc = 0. customers-name = ‘John’. UPDATE."— Presentation transcript:

1 User Dialog Overview

2 Update Statement TABLES customers. SELECT SINGLE * FROM customers WHERE id = 1. IF sy-subrc = 0. customers-name = ‘John’. UPDATE customers. ENDIF.

3 Database Server Application Server Dispatcher Request Queue DDDD … SAP Buffer Program … User Context Area 1 3 4 6 79 10 11 Report zpsm1. Tables customers. Select single * from customers where id = 1. Write: / customers-name. 5 Execute ABAP stateme nt Check Program in Program Buffer Roll in 8 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 SAP System : Dialog Processing D010Scustomers

4 TaskHandler DYNPRO Processor ABAP Processor Local Memory Memory Space DB Interface List Buffer Database Server Dialog Work Process User Context Dialog WP : Report Result Set Memory

5 Database Server Application Server Dispatcher Request Queue DDDD … SAP Buffer Program … User Context Area 1 3 4 6 79 10 11 5 Execute ABAP stateme nt Check Program in Program Buffer Roll in 8 Load&Gen Program SQL Request Send List Send Request Request 2 Search for free WP Store request to queue Send request to WP SAP GUI SAP System : Dialog Processing Generate Dialog Screen Screen PROGRAM sapmzex001. INCLUDE …. CALL SCREEN 100. … D010Scustomers

6 TaskHandler DYNPRO Processor ABAP Processor Local Memory Memory Space DB Interface Screen Buffer Database Server Dialog Work Process User Context Dialog WP : Dialog Program Result Set Memory

7 Dialog Program : Transaction

8 Dialog Program Components Transaction Code 100 Screen : 100 (Screen Layout) 200 Screen : 200 (Screen Layout) Flow Logic PBO PAI ABAP Module Pool PBO PAI ABAP Module Pool Dialog Program Program Naming Convention : SAPM[Z/Y] …

9 Data Transfer (Local Memory) Screen Buffer ABAP Memory Space Screen Work AreaABAP Work Area PBO PAI customers-id customers id name city … 0000000 ok_code Local Memory Element List

10 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.

11 OK Code Field in Screen OK Code Field or Command Field (ok_code in Element List)

12 Defining Screen (4 Steps) Screen Attribute Screen Layout Flow Logic Element List Element List(ok_code field)

13 Flow Logic in Screen 100 PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.

14 PBO in Screen 100 MODULE status_0100 OUTPUT. SET PF-STATUS ‘ 0100 ’. SET TITLEBAR ‘ 0100 ’. ENDMODULE.

15 PAI in Screen 100 MODULE user_command_0100 INPUT. CASE ok_code. WHEN ‘BACK’. LEAVE PROGRAM. WHEN space. SELECT SINGLE * FROM customers WHERE id = customers-id. IF sy-subrc = 0. LEAVE TO SCREEN 200. ENDIF. ENDCASE. ENDMODULE.

16 How to Create Dialog Program Transaction SE80 : Create Dialog Program (SAPMY/Z … ) Create Screen(4 steps) Screen Attribute (Description) Screen Layout (Graphic Screen Painter) Flow Logic(PBO,PAI) Define Variable ok_code in Element List Define Data Objects in ABAP Work Area at TOP Include(TABLES, DATA,...) Check and Activate Dialog Program Create Transaction Code (Y/Z … )

17 Example I Maintain Customers Data Screen : 100 Screen : 200

18 Example I Create Dialog Program SAPMZEX for changing Customers table Screen 100 Field customers-id Screen 200 Field customers-id and customers-name

19 Example I Screen 100 PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.

20 Example I Screen 100 MODULE status_0100 OUTPUT. SET PF-STATUS ‘ 0100 ’. SET TITLEBAR ‘ 0100 ’. CLEAR ok_code. ENDMODULE.

21 Example I Screen 100 MODULE user_command_0100 INPUT. CASE ok_code. WHEN ‘ BACK ’. LEAVE PROGRAM. “ leave to screen 0 WHEN space. SELECT SINGLE * FROM customers WHERE id = customers-id. LEAVE TO SCREEN 200. ENDCASE. ENDMODULE.

22 Example I Screen 200 PROCESS BEFORE OUTPUT. MODULE STATUS_0200. PROCESS AFTER INPUT. MODULE USER_COMMAND_0200.

23 Example I Screen 200 MODULE status_0200 OUTPUT. SET PF-STATUS ‘ 0200 ’. SET TITLEBAR ‘ 0200 ’. CLEAR ok_code. ENDMODULE.

24 Example I Screen 200 MODULE user_command_0200 INPUT. CASE ok_code. WHEN ‘ BACK ’. LEAVE TO SCREEN 100. “ SET SCREEN 100. LEAVE SCREEN. WHEN ‘ SAVE ’. UPDATE customers. MESSAGE s000(38) WITH ‘ Update OK! ’. LEAVE TO SCREEN 100. ENDCASE. ENDMODULE.

25 Example I TOP Include TABLES customers. DATA ok_code TYPE sy-ucomm. Create Transaction Code Transaction Code : ZEX

26 Exercise Create Dialog Program : SAPMZCUST Transaction Code : ZCUST

27 Exercise : Customers Maintenance Screen : 100 Screen : 200

28 Checking User Input Check Input Data Using FIELD Statement

29 FIELD Statement Screen 100 : Flow Logic (PAI) PROCESS AFTER INPUT. FIELD customers-id MODULE user_command_0100.

30 Example I Screen 100 : PAI MODULE 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.


Download ppt "User Dialog Overview. Update Statement TABLES customers. SELECT SINGLE * FROM customers WHERE id = 1. IF sy-subrc = 0. customers-name = ‘John’. UPDATE."

Similar presentations


Ads by Google