1

I have a webdynpro containing a table displaying numerous lines. After the user clicks the delete button I want to delete the selected line of the table.

My problem right now is, that I don't know how to implement this in the event-call.

How can I identify the selected line of the table?

4

2 回答 2

1

如果“表格”是指可编辑的 ALV,则有一个预设功能。看看http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htmhttp://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset。 htm有关如何手动处理选择的详细信息,请参阅http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm

于 2010-05-16T08:04:24.137 回答
-1

我终于得到了解决方案:

在按钮事件中执行以下操作,以访问节点,最后访问 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.
于 2010-05-17T11:40:50.793 回答