我有一个webdynpro包含一个显示多行的表。 用户单击删除按钮后,我想删除表中选定的行。
我现在的问题是,我不知道如何在事件调用中实现它。 如何识别表格的选定行?
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?
最满意答案
如果“table”表示可编辑的ALV,则为此设置预设功能。 请查看http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm和http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset。 htm有关如何手动处理选择的详细信息,请参阅http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm 。
I finally got the solution:
In the button event implement the following, to access the node and finally the id-value:
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.更多推荐
发布评论