我有一个webdynpro,其中包含一个显示大量行的表。用户单击“删除”按钮后,我想删除表的所选行。

我现在的问题是,我不知道如何在事件通话中实现此目标。如何识别表的选定行?

有帮助吗?

解决方案 2

我终于得到了解决方案:

在按钮事件中实现以下内容,访问节点,最后是ID值:

method ONACTIONZSS10_15_ONDELETE .  
  DATA ls_cust type wd_this->element_IT_Cust.
  DATA lo_nd_cust TYPE REF TO if_wd_context_node.
  DATA lo_el_cust TYPE REF TO if_wd_context_element.

  " Get the selected element
  lo_nd_cust = wd_context->get_child_node( name = 'IT_CUST' ).
  lo_el_cust = lo_nd_cust->get_element( ).

  " Get the attributes of the node-element
  lo_el_cust->get_static_attributes(
    IMPORTING
      static_attributes = ls_cust ).

  " Call the delete-function
  CALL FUNCTION 'ZSS10_15_CUST_FM_DELETE'
    EXPORTING
      custid        = ls_cust-ID
            .
endmethod.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top