ALV实例:默认选择行与列

DATA : lt_column     TYPE salv_t_column,

           lr_selections TYPE REF TO cl_salv_selections,

           lt_row           TYPE salv_t_row,

 


    "选择列

    APPEND 'FLTIME' TO lt_column.

    APPEND 'DISTANCE' TO lt_column.

    lr_selections->set_selected_columns( lt_column ).

    "选择行

    APPEND 3 TO lt_row.

    APPEND 4 TO lt_row.

    lr_selections->set_selected_rows( lt_row ).

 

method set_selected_rows.

  me->t_selected_rows = value.

  rows_rec = abap_true.

  check me->r_controller is bound.

  r_controller->set_changed(
    name    = me->name
    method  = 'SET_SELECTED_ROWS'
    object  = if_salv_controller_changelist=>c_selection_row
    ref     = me
    flavour = if_salv_c_changelist_flavour=>selections ).

endmethod.

 

 

method set_selected_columns.

  me->t_selected_columns = value.

  cols_rec = abap_true.

  check me->r_controller is bound.

  r_controller->set_changed(
    name    = me->name
    method  = 'SET_SELECTED_COLUMNS'
    object  = if_salv_controller_changelist=>c_selection_column
    ref     = me
    flavour = if_salv_c_changelist_flavour=>selections ).

endmethod.

ALV输出时,默认选择行与列代码

你可能感兴趣的:(SAP技术,SAP,ABAP,ALV)