如何在WebDynPro ABAP表中获取所选条目?
题
我有一个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.
其他提示
如果通过“表”是指可编辑的ALV,则有一个预设功能。看一眼 http://help.sap.com/saphelp_nw04s/helpdata/en/5f/5f/ec57c72a1349c8bfdda56d976e93999399/frameset.htm 和 http://help.sap.com/saphelp_nw04s/helpdata/en/5f/5f/ec57c72a1349c8bfdda56d976e93999399/frameset.htm 有关如何手动处理选择的详细信息,请参阅 http://help.sap.com/saphelp_nw04s/helpdata/en/5f/5f/ec57c72a1349c8bfdda56d976e93999399/frameset.htm.
不隶属于 StackOverflow