cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/Disable link to Action in ALV table column

former_member282823
Active Participant
0 Kudos

Hi,

  I have an ALV table and in one of the columns I have ALV link to action the requirement now is to make few rows as link to action and few as text view depending on the conditions.

I tried to do it using Cell Variant, but i am getting complete link to action or complete text view.

Kindly let me know if any possible solutions are there.

REgards,

Ramesh.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

you can achieve this using cell variant. Check this document which suits your requirement : Cell Variant for WDA ALV

hope this helps u.,

Regards,

Kiran

former_member282823
Active Participant
0 Kudos

Hi Kiran,

  i tried using cell variant but it is not coming

former_member282823
Active Participant
0 Kudos

Thanks Kiran, problem solved.

Regards,

Ramesh.

Answers (3)

Answers (3)

amy_king
Active Contributor
0 Kudos

Hi Ramesh,

You don't need to change the cell editor from LinkToAction to TextView. You can use LinkToAction for all rows and simply set the LinkToAction's enabled property for each row to true or false (as Ismail has demonstrated). When LinkToAction.enabled is true, the link is click-able. When LinkToAction.enabled is false, the link will appear as text and not be click-able (it will appear just like a TextView).

Cheers,
Amy

former_member211591
Contributor
0 Kudos

Hi,

try this:

if you already have Link_to_action (LTA) for all fields of your column, you have something like this where you assign the cell editor to your column:

   data: lr_DRG_STAT_lta type ref to CL_SALV_WD_UIE_link_to_action.
   create OBJECT lr_DRG_STAT_lta.

   lr_DRG_STAT_ICON_clmn->SET_CELL_EDITOR( exporting value = lr_DRG_STAT_lta ).

you just need to do this:

Create one more column in your context-node. Lets call it COL_ENABLED of type WDY_BOOLEAN, in which you write ABAP_TRUE for LTA enabled, and ABAP_FALSE for LTA disabled (depending on your conditions for each row).

And then you just need to add following line to your code.

Method SET_ENABLED_FIELDNAME of CL_SALV_WD_UIE_link_to_action enables or disables LTA depending on value given in COL_ENABLED.

   data: lr_DRG_STAT_lta type ref to CL_SALV_WD_UIE_link_to_action.
   create OBJECT lr_DRG_STAT_lta.

   lr_drg_STAT_lta->SET_ENABLED_FIELDNAME( 'COL_ENABLED' ).

   lr_DRG_STAT_ICON_clmn->SET_CELL_EDITOR( exporting value = lr_DRG_STAT_lta ).

This should work, me myself didn't try it. Please inform about success..

Regards

ismail

venkateswaran_k
Active Contributor
0 Kudos

If i am not wrong, you can handle this in field_catalog specification.

Can you try that

former_member282823
Active Participant
0 Kudos

Hi Venkateswaran,

  Could you provide me some sample coding on this.

Regards,

Ramesh.