on 08-22-2007 11:18 AM
Hi,
i use an alv and want to show in one column only linkToUrl-UI's. I can do that with the following piece of code, but the problem is that every referece and text of my linkToUrl is the same.
How can i give the LinkToUrl-UI's in my ALV different text and references?
*... Invoke a method of the ALV Interfacecontroller
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_usage_alv( ).
* get Model
DATA: lr_cmdl TYPE REF TO cl_salv_wd_config_table.
lr_cmdl = l_ref_interfacecontroller->get_model( ).
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lr_column TYPE REF TO cl_salv_wd_column.
* get Column
lr_column_settings ?= lr_cmdl.
lr_column = lr_column_settings->get_column( 'DESCR' ).
* create LikToUrl
DATA lr_link TYPE REF TO cl_salv_wd_uie_link_to_url.
CREATE OBJECT lr_link.
lr_link->set_text( 'Open Document' ).
lr_link->set_reference( 'http://www.google.de' ).
lr_column->set_cell_editor( lr_link ).
regards,
Sharam
Hi Sharam,
Yes, you can do it. Introduce two attributes in the same context node, say 'LINK_TEXT' and 'LINK_URL' of type string. When you create the link to url and make it your cell editor, add the following piece of code:
lr_link->set_text_fieldname( 'LINK_TEXT' ).
lr_link->set_reference_fieldname( 'LINK_URL' ).
Now when you populate your internal table to display data, populate these fields accordingly. The text will be taken dynamically from the field link_text and the url will be taken from link_url.
Hope this helps.
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.