cancel
Showing results for 
Search instead for 
Did you mean: 

Identifying which line was selected from a WebDynpro table

Former Member
0 Kudos

Hi,

can any one give me some advice, I've created a view which displays a table of filenames, which in fact are "LinkToAction" columns. The idea was that when a filename(LinkToAction) was selected, I could retrieve the appropriate file from the Applicatio server and Open the file in Excel or Save as Excel. My problem is, when I select a filename I don't know how to identify what line was selected in the table. Any advice would be great.

Thanks,

C

Accepted Solutions (1)

Accepted Solutions (1)

S-H
Active Participant
0 Kudos

Hi,

If you are using the table control and wanted to find out which cell (linktoaction UI element) was selected.

For the LinkToAction UI element in table you would have written OnAction event method for the cell. In this method there is a parameter WDEVENT. In the degugging mode you can check the value of WDEVENT which is having the value of the row which user has selected(drilldown on linktoaction).

You can get this value from the CONTEXT_ELEMENT id of wdevent parameter. The sample code to get the static paramters in WDEVENT is


lo_el_spfli = WDEVENT->GET_CONTEXT_ELEMENT( NAME = 'CONTEXT_ELEMENT' ).

  lo_el_spfli->get_static_attributes(
    IMPORTING
      static_attributes = ls_spfli ).

Best regards,

Suresh

Former Member
0 Kudos

Hi Suresh,

thankyou for your comments, one other question regarding your example code.

how do you define "lo_el_spfli" in your example?

thanks

C

Former Member
0 Kudos

Hi C.

Data:

lo_el_spfli type ref to if_wd_context_element.

Cheers,

Sascha

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi , Just identify its element which is lead selected and read attribut of that element .

Have the code for the same

DATA:

node_nd_worlflow TYPE REF TO if_wd_context_node,

elem_nd_worlflow TYPE REF TO if_wd_context_element,

stru_nd_worlflow TYPE wd_this->element_nd_worlflow ,

lead_selection_index TYPE i,

relation_no TYPE guid_32.

  • navigate from <CONTEXT> to <ND_WORLFLOW> via lead selection

node_nd_worlflow = wd_context->get_child_node( name = wd_this->wdctx_nd_worlflow ).

  • @TODO handle not set lead selection

IF ( node_nd_worlflow IS INITIAL ).

ENDIF.

  • get element via lead selection

lead_selection_index = node_nd_worlflow->get_lead_selection_index( ).

elem_nd_worlflow = node_nd_worlflow->get_element( index = lead_selection_index ).

elem_nd_worlflow->get_static_attributes( IMPORTING static_attributes = stru_nd_worlflow ).

Cheers

Parry