views:

266

answers:

2

Hallo,

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?

Best regards Philipp

+1  A: 

If by "table" you mean an editable ALV, there's a preset function for this. Take a look at http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm and http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm For details on how to process the selection manually, see http://help.sap.com/saphelp_nw04s/helpdata/EN/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm.

vwegert
you posted 3 times entirely the same link. i bet you walked into the frameset-trap like me some days ago.
Philipp Andre
A: 

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.
Philipp Andre