Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dialog Programming What is Dialog Programming? 新增Screen與設定Attributes

Similar presentations


Presentation on theme: "Dialog Programming What is Dialog Programming? 新增Screen與設定Attributes"— Presentation transcript:

1 Dialog Programming What is Dialog Programming? 新增Screen與設定Attributes
設計Screen Layout 傳接資料 設定PushButton 宣告OK_code與Element List Flow Logic Control設定 建立Module 編輯Module內容 串接Screen

2 1. What is Dialog Programming?
與使用者互動、畫面變化更多 可跨多個畫面 (screen) 透過screen painter來做設計 程式更為複雜 ABAP Code Layout Menu

3 Part of Screen Screen Attributes Screen Layout Element List
Flow Logic Control

4 2. 新增Screen與設定Attributes
對Screen name double-click 開啟ABAP Editor,編輯新程式,並輸入CALL SCREEN <name>. Next screen表示該screen的所有動作,均會跳到某screen,若填0則表示回上層

5 3. 設計Screen Layout 點選Layout按鈕 ,設計Screen Layout 拖曳物件,並設定其屬性

6 3.1 傳接資料 直接將ABAP Dictionary的table對應至screen (1)先於程式碼中,宣告Tables
TABLES <abap dictionary table>. (2)再於Screen Layout中 物件之name設定成相同table的欄位

7 傳接資料圖例 程式碼先宣告:TABLES SDYN_BOOK. 再定義物件之name屬性為:Table名稱-欄位

8 3.2 設定PushButton 拉出一個Button,設定FntCode值(任意)

9 4. 宣告OK_code與Element List
接收Function Code (FntCode)值之作法 先在程式中,將ok_code宣告為sy-ucomm 例:DATA: ok_code LIKE sy-ucomm.

10 Element List設定 點選Element List標籤,可看到拉出物件之列表 在最後的空欄位中,填入ok_code

11 5. Flow Logic Control設定 控制程式執行及screen呼叫順序
PBO (Process Before Output) MODULE 設定Screen在顯示前欲做的處理動作,一般用來設定預設值,如清空輸入欄位值等。 PAI (Process After Input) MODULE 設定Screen在使用者輸入指令後欲處理的動作,如呼叫下個Screen,對資料庫進行操作等。

12 PBO、PAI之流程

13 5.1 建立Module 選擇Flow Logic標籤,將Module註解取消

14 5.2 編輯Module內容 於ABAP Editor中,編輯Module的內容

15 5.3 串接Screen

16 串接Screen 方法1 設定Next Screen

17 串接Screen 方法2 在PAI Module中呼叫

18 Dialog Programming舉例 ABAP程式編輯 Double click 100.
DATA: ok_code LIKE sy-ucomm. Call Screen 100. Double click 100. 建立兩個buttons,分別為continue及exit,其fncode分別為C與E 輸入ok_code於element list中 將flow logic之註解uncomment.

19 Dialog Programming舉例 (Cont.)
回到ABAP程式編輯 Module user_command_0100 input. case ok_code. when 'C'. call screen 200. when 'E'. leave program. endcase. EndModule.

20 練習 根據zyy**_EMP表格: 撰寫Screen 200 撰寫Screen 300
請自行設計輸入介面,讓使用者輸入name之條件,再呼叫Screen 300 請設計一按鈕回上一層 撰寫Screen 300 根據使用者 輸入name之條件,由資料庫中將該員工之資料顯示於螢幕上


Download ppt "Dialog Programming What is Dialog Programming? 新增Screen與設定Attributes"

Similar presentations


Ads by Google