[英]How to select all rows in ALV OO?
我已經使用標准 PBO/PAI 創建了一個帶有CL_GUI_ALV_GRID
的 ALV,但是當我使用該方法時,我通過這種方式修改布局以包括每一行的復選框:
g_layout-zebra = 'X'.
g_layout-cwidth_opt = 'X'.
g_layout-cwidth_opt = 'X'.
g_layout-sel_mode = 'D'.
gv_variant-report = sy-repid.
gv_variant-username = sy-uname.
它默認顯示為未選中,我怎樣才能 select 所有行? 是否有可能 select 超過一行單擊復選框?
Shift+Click
最后一行的 select 按鈕 使用set_selected_rows
方法。 喜歡
lo_alv->set_selected_rows(
it_row_no = VALUE #( FOR i = 1 THEN i + 1 WHILE i <= lines( lt_sflight ) ( row_id = i ) )
).
(假設顯示的表是lt_sflight
)
可以在此處找到其他文檔。
您可以像這樣使用set_selected_rows方法。
data: lr_selections type ref to cl_salv_selections,
lt_rows type salv_t_row,
lv_count type i.
describe table gt_table lines lv_count.
do lv_count times.
append sy-index to lt_rows.
enddo.
lr_selections = gr_alv->get_selections( ).
lr_selections->set_selected_rows( lt_rows ).
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.