1 / 35

Interactive List Techniques

Interactive List Techniques. Detail Lists Program Flow in Detail Lists Events Page Headings SET TITLEBAR Data Transport Selecting Multiple Lines Field Selection System Fields for interactive Lists 補充:利用 ALV GRID 顯示資料. 1. Detail Lists. Program Flow in Detail Lists. Creating Data Lists.

brendy
Download Presentation

Interactive List Techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interactive List Techniques • Detail Lists • Program Flow in Detail Lists • Events • Page Headings • SET TITLEBAR • Data Transport • Selecting Multiple Lines • Field Selection • System Fields for interactive Lists • 補充:利用ALV GRID顯示資料

  2. 1. Detail Lists

  3. Program Flow in Detail Lists

  4. Creating Data Lists

  5. Creating Data Lists

  6. 練習1-1 REPORT Z9901_0518A. START-OF-SELECTION. WRITE:/ 'BASIC LIST', SY-LSIND. AT LINE-SELECTION. WRITE:/ 'DETAIL LIST', SY-LSIND.

  7. 練習1-1執行結果

  8. Events: Overview

  9. Page Headings

  10. 練習1-2 REPORT Z9901_0518A. START-OF-SELECTION. FORMAT HOTSPOT ON COLOR 3 INVERSE ON. WRITE:/ 'BASIC LIST', SY-LSIND. TOP-OF-PAGE. WRITE: 'TITLE1:', SY-TITLE. ULINE. AT LINE-SELECTION. WRITE:/ 'DETAIL LIST', SY-LSIND. TOP-OF-PAGE DURING LINE-SELECTION. write:/ 'TITLE2'.

  11. 練習1-2執行結果

  12. SET TITLEBAR

  13. 練習1-3 REPORT Z9901_0518A NO STANDARD PAGE HEADING. START-OF-SELECTION. SET TITLEBAR 'T01' WITH SY-DATUM. FORMAT HOTSPOT ON COLOR 3 INVERSE ON. WRITE:/ 'BASIC LIST', SY-LSIND. TOP-OF-PAGE. WRITE: 'TITLE1:', SY-TITLE. ULINE. AT LINE-SELECTION. SET TITLEBAR 'T02' WITH SY-LSIND. WRITE:/ 'DETAIL LIST', SY-LSIND. TOP-OF-PAGE DURING LINE-SELECTION. write:/ 'TITLE2'.

  14. 練習1-3執行結果

  15. 2. Data Transport

  16. The HIDE Technique

  17. 練習2 REPORT Z9901_0518B. START-OF-SELECTION. TABLES Z9901SELECTION. SELECT * FROM Z9901SELECTION. FORMAT HOTSPOT ON COLOR 5 INVERSE ON. WRITE:/ Z9901SELECTION-SNO, Z9901SELECTION-SNAME, Z9901SELECTION-CNO. HIDE: Z9901SELECTION-CNO. ENDSELECT. AT LINE-SELECTION. TABLES Z9901COURSE. SELECT * FROM Z9901COURSE WHERE CNO = Z9901SELECTION-CNO. WRITE:/ Z9901COURSE-CNO, Z9901COURSE-CNAME, Z9901COURSE-CGRADE, Z9901COURSE-TEACHER. ENDSELECT.

  18. 練習2執行結果

  19. 3. Selecting Multiple Lines DATA MARK. WRITE:/ MARK AS CHECKBOX, … AT LINE-SELECTION. DO. CLEAR MARK. READ LINE SY-INDEX FIELD VALUE MARK. IF SY-SUBRC <> 0. EXIT. ENDIF. IF MARK <> SPACE. WRITE:/ Z9901SELECTION-SGRADE, Z9901SELECTION-SNAME. MODIFY CURRENT LINE FIELD VALUE MARK FROM SPACE. ENDIF. ENDDO.

  20. 練習3 REPORT Z9901_0518C. DATA MARK. START-OF-SELECTION. TABLES Z9901SELECTION. SELECT * FROM Z9901SELECTION. FORMAT HOTSPOT ON COLOR 5 INVERSE ON. WRITE:/ MARK AS CHECKBOX, Z9901SELECTION-SNO, Z9901SELECTION-SNAME, Z9901SELECTION-CNO. HIDE: Z9901SELECTION-SGRADE, Z9901SELECTION-SNAME. ENDSELECT.

  21. 練習3 (續) AT LINE-SELECTION. DO. CLEAR MARK. READ LINE SY-INDEX FIELD VALUE MARK. IF SY-SUBRC <> 0. EXIT. ENDIF. IF MARK <> SPACE. WRITE:/ Z9901SELECTION-SGRADE, Z9901SELECTION-SNAME. MODIFY CURRENT LINE FIELD VALUE MARK FROM SPACE. ENDIF. ENDDO.

  22. 練習3執行結果

  23. 4. Field Selection

  24. 5. System Fields for interactive Lists

  25. Creating Lists in Model Dialog Boxes

  26. 6. 補充:利用ALV GRID顯示資料(應用物件導向及dialog programming)

  27. 實作:(1) SE38查詢SAPBC400*

  28. 實作:(2)複製 SAPBC400RUS_ALV_GRID為zpu101_xx_alv_grid

  29. 實作:(3)修改程式

  30. 修改程式碼 REPORT zpu101_01_alv_grid2 . DATA gdt_spfli TYPE STANDARD TABLE OF zpu101_01_art. DATA ok_code LIKE sy-ucomm. DATA: container_r TYPE REF TO cl_gui_custom_container, grid_r TYPE REF TO cl_gui_alv_grid. START-OF-SELECTION. * fill internal table SELECT * FROM zpu101_01_art INTO TABLE gdt_spfli. CALL SCREEN 100.

  31. 修改程式碼 MODULE create_control OUTPUT. IF container_r IS INITIAL. CREATE OBJECT container_r EXPORTING container_name = 'CONTAINER_1'. CREATE OBJECT grid_r EXPORTING i_parent = container_r. CALL METHOD grid_r->set_table_for_first_display EXPORTING i_structure_name = ' zpu101_01_art' CHANGING it_outtab = gdt_spfli. ENDIF. ENDMODULE.

  32. 實作:(4)存檔,Activate

  33. 實作:(5)執行結果

  34. 練習:讓使用者以進階查詢方式,輸入團體編號範圍,進行查詢練習:讓使用者以進階查詢方式,輸入團體編號範圍,進行查詢

  35. 修改程式碼參考 REPORT zpu101_01_alv_grid2 . DATA gdt_spfli TYPE STANDARD TABLE OF zpu101_01_art. DATA ok_code LIKE sy-ucomm. DATA: container_r TYPE REF TO cl_gui_custom_container, grid_r TYPE REF TO cl_gui_alv_grid. tables zpu101_01_show. SELECT-OPTIONS team for zpu101_01_show-team. START-OF-SELECTION. * fill internal table SELECT * FROM zpu101_01_art INTO TABLE gdt_spfli where artid in team. CALL SCREEN 100.

More Related