SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style. italic; color: #808080; } .L0S52 { color: #0000FF; } *&---------------------------------------------------------------------*
*& Report Z_ALV_CREATION
*& Creation with OO Programming
*& from BC405
*&---------------------------------------------------------------------*
REPORT z_alv_creation.
DATA: flight_tab TYPE TABLE OF sflight.
DATA: flight_line LIKE LINE OF flight_tab.
DATA: gr_alv TYPE REF TO cl_salv_table. " gr for global reference
SELECT-OPTIONS:
so_car FOR flight_line-carrid, " so for select options
so_con FOR flight_line-connid.
start-of-selection.
* retrieve data into internal table
SELECT * FROM sflight
INTO TABLE flight_tab
WHERE carrid IN so_car
AND connid IN so_con.
* create alv instance
CALL METHOD cl_salv_table=>factory
IMPORTING
R_SALV_TABLE = gr_alv
CHANGING
t_table = flight_tab.
* display data
CALL METHOD gr_alv->display.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/782823/viewspace-582291/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/782823/viewspace-582291/