Question

J'ai un webdynpro contenant une table affichant de nombreuses lignes. Une fois que l'utilisateur a cliqué sur le bouton Supprimer, je souhaite supprimer la ligne sélectionnée du tableau.

Mon problème en ce moment est que je ne sais pas comment implémenter cela dans l'appel de l'événement. Comment puis-je identifier la ligne sélectionnée du tableau?

Était-ce utile?

La solution 2

J'ai enfin eu la solution:

Dans l'événement bouton, implémentez ce qui suit, pour accéder au nœud et enfin la valeur 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.

Autres conseils

Si par "table", vous voulez dire un ALV modifiable, il y a une fonction prédéfinie pour cela. Jeter un coup d'œil à http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm et http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm Pour plus de détails sur la façon de traiter la sélection manuellement, voir http://help.sap.com/saphelp_nw04s/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top