cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Some URL on click of a column in ALV table

Former Member
0 Kudos

Hi,

I am displaying a ALV table .in one of the columns i want to have a link and on clicking on that it should call a url by passing the pernr of that row.

url will be something like http://orgchart.asp?pernr=pernr.

please let me know the solution

Accepted Solutions (0)

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

1. fill the URLs with the pernr number in the Context Node binded to your ALV

2. follow the code to create LinkToUrl in ALV

DATA:

lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_link_to_url TYPE REF TO CL_SALV_WD_UIE_LINK_TO_URL.

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

DATA: l_value TYPE REF TO cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

lr_column_settings ?= l_value.

lr_column = lr_column_settings->get_column( '<name of the attribute>' ).

CREATE OBJECT lr_link_to_url.

lr_link_to_url->SET_REFERENCE_FIELDNAME( '<name of the attribute where URL is filled>' ).

lr_column->set_cell_editor( lr_link_to_url ).

for more information see (page-6)

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-818...

also see

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/60ea94e5-0901-0010-c3bb-aad5e...

Abhi

Former Member
0 Kudos

I solved it on my own.anyway thanks for the help