Pregunta

Tengo un WebDynPro que contiene una tabla que muestra numerosas líneas. Después de que el usuario hace clic en el botón Eliminar, quiero eliminar la línea seleccionada de la tabla.

Mi problema en este momento es que no sé cómo implementar esto en la llamada de eventos. ¿Cómo puedo identificar la línea seleccionada de la tabla?

¿Fue útil?

Solución 2

Finalmente obtuve la solución:

En el evento de botón implementa lo siguiente, para acceder al nodo y finalmente al valor de identificación:

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.

Otros consejos

Si por "tabla" te refieres a un ALV editable, hay una función preestablecida para esto. Echa un vistazo a http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm y http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm Para obtener detalles sobre cómo procesar la selección manualmente, ver http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top