0

在开始开发之前,我正在寻找一种标准的方式来做这样的事情:我需要实现用户友好的方式来在标准 Dynpro ALV 网格中对表行进行排序。我认为它应该看起来像定义过滤器列的形式,例如在标准功能模块中实现的形式LVC_FILTER

4

1 回答 1

0

不,这没有标准功能。但是,您可以通过在运行时插入/删除 itab 行以编程方式执行此操作(通过拖放进行手动表排序)。这可以使用标准 ALV 事件来实现:ondragondropondropcomplete。尝试使用这些代码示例来实现方法:

method handle_grid_ondrag.

data: data_object type ref to drag_drop_object,
      help_row like line of gt_outtab.                  "#EC NEEDED

      read table gt_outtab_2 into help_row index es_row_no-row_id.
      create object data_object.
      move es_row_no-row_id to data_object->index.
      read table gt_outtab_2 into data_object->wa_test index
      es_row_no-row_id.
      e_dragdropobj->object = data_object.

endmethod.     

_

method handle_grid_ondrop.

data: data_object type ref to drag_drop_object,
      drop_index type i,
      help_row like line of gt_outtab.                  "#EC NEEDED

      delete gt_outtab_2 index data_object->index.
      insert data_object->wa_test into gt_outtab_2 index e_row-index

endmethod.

_

 method handle_grid_ondropcomplete.

  if data_cel = ' '.
    call method grid->refresh_table_display.
  endif.

endmethod.

BCALV_TEST_DRAG_DROP_02如果您有困难,请参阅示例程序。

于 2015-12-24T16:32:48.483 回答