我有一个webdynpro,其中包含一个显示许多行的表格。在用户单击delete按钮后,我想删除表中选定的行。
我现在的问题是,我不知道如何在event-call中实现它。
如何识别表格中选中的行?
发布于 2010-05-17 19:40:51
我终于得到了解决方案:
在按钮事件中,实现以下内容,以访问节点,最后访问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.发布于 2010-05-16 16:04:24
如果你所说的“表”指的是一个可编辑的ALV,那么它有一个预置函数。有关如何手动处理选择的详细信息,请参阅http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm。
https://stackoverflow.com/questions/2840186
复制相似问题