Interactive list techniques
This presentation is the property of its rightful owner.
Sponsored Links
1 / 35

Interactive List Techniques PowerPoint PPT Presentation


  • 59 Views
  • Uploaded on
  • Presentation posted in: General

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.

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


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

1. Detail Lists


Program flow in detail lists

Program Flow in Detail Lists


Creating data lists

Creating Data Lists


Creating data lists1

Creating Data Lists


Interactive list techniques

練習1-1

REPORT Z9901_0518A.

START-OF-SELECTION.

WRITE:/ 'BASIC LIST', SY-LSIND.

AT LINE-SELECTION.

WRITE:/ 'DETAIL LIST', SY-LSIND.


Interactive list techniques

練習1-1執行結果


Events overview

Events: Overview


Page headings

Page Headings


Interactive list techniques

練習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'.


Interactive list techniques

練習1-2執行結果


Set titlebar

SET TITLEBAR


Interactive list techniques

練習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'.


Interactive list techniques

練習1-3執行結果


2 data transport

2. Data Transport


The hide technique

The HIDE Technique


Interactive list techniques

練習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.


Interactive list techniques

練習2執行結果


3 selecting multiple lines

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.


Interactive list techniques

練習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.


Interactive list techniques

練習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.


Interactive list techniques

練習3執行結果


4 field selection

4. Field Selection


5 system fields for interactive lists

5. System Fields for interactive Lists


Creating lists in model dialog boxes

Creating Lists in Model Dialog Boxes


6 alv grid dialog programming

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


1 se38 sapbc400

實作:(1) SE38查詢SAPBC400*


2 sapbc400rus alv grid zpu101 xx alv grid

實作:(2)複製 SAPBC400RUS_ALV_GRID為zpu101_xx_alv_grid


Interactive list techniques

實作:(3)修改程式


Interactive list techniques

修改程式碼

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.


Interactive list techniques

修改程式碼

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.


4 activate

實作:(4)存檔,Activate


Interactive list techniques

實作:(5)執行結果


Interactive list techniques

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


Interactive list techniques

修改程式碼參考

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.


  • Login