cancel
Showing results for 
Search instead for 
Did you mean: 

WDABAP: hyperlink in table column

Former Member
0 Kudos

Hi all,

I have a table that has property -Selection Mode 'None'.

The table is bounded to a node whose 'Initialization Lead Selection' property is not checked. One of the columns in the table is a hyperlink and is an image. It does not have a text. One of the other columns is an Item Id. When the link in a particular row is clicked, it has to diplay the item values in the next screen based on the item id. Is there anyway to do it.

Thanks,

Sravanthi

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sravanti,

In order to get the selected row, you can follow the below code:

where io_wdevent is the event object (type ref to CL_WD_CUSTOM_EVENT)

* Get selected step.
  lo_element = io_wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
  lo_element->get_attribute( exporting name  = 'STEPTEXT'
                             importing value = lv_steptext ).

Hope it helps....

Regards,

Ravi

Former Member
0 Kudos

Hi,

in action related to hyper link write the coding related to lead selction.

use node->set_lead_selection(exporting element = lo_element).

baskaran00
Active Participant
0 Kudos

Hi Matura,

U have a table with hyperlink in one column.

if user clicks on the hyperlink, based on text id u should display the data in next screen.

Am i right?

Follow the below code:

1. It will get the current index

2. from the current index u can get the text id.

data lc_index type I.

DATA lo_node TYPE REF TO if_wd_context_node.

DATA lo_element TYPE REF TO if_wd_context_element.

lo_node = wd_context->get_child_node( name = 'XXXX' ).

lo_element = lo_node->get_element( ).

IF not lo_element IS INITIAL.

lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

CALL METHOD LO_ELEMENT->GET_INDEX( RECEIVING MY_INDEX = lc_index ).

CALL METHOD LO_NODE->CLEAR_SELECTION.

CALL METHOD LO_NODE->SET_LEAD_SELECTION_INDEX( EXPORTING INDEX = lc_index ).

CALL METHOD LO_NODE->SET_LEAD_SELECTION( EXPORTING ELEMENT = lo_element ).

lo_element->get_attribute( EXPORTING name = `TEXT_ID` IMPORTING value = lv_text_id ).

ENDIF.

Thankx,

Router

Former Member
0 Kudos

Sravanthi,

In Outline view, select your Table UI:

1. right-click on Table and "Insert column"

2. right-click on the new column and "Insert TableCellEditor"

3. In the list, select type LinkToAction

4. So, you'll be able to bind that new LinkToAction to your context structure, create event handler and so on.

Hope it helps

thomas_szcs
Active Contributor
0 Kudos

Hi Sravanthi,

Sure, this is possible. Use LinkToAction ui element as a cell editor of the link-containing column and navigate to the desired view from within the action handler that you bind to the onAction event of the LinkToAction ui element.

Best regards,

Thomas