cancel
Showing results for 
Search instead for 
Did you mean: 

How to conditionally disable a Row of ALV Table

former_member220853
Participant
0 Kudos

Dear All

I have a requirement to conditionally disable selection of a particular row of alv table

Actually I am providing hyperlink on fist column of table  and actual requirement is to disable this hyperlink based on the attributes of particular row this hyperlink falls under. If that row contains value of those key attributes I need to enable the hyperlink

But in ALV we just define the structure statically and then bind the data to it so I am not sure how can this be achieved

Please let me know points will be rewarded

Best Regards

Gaurav

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Gaurav,

You need to add an attribute ENABLED of type WDY_BOOLEAN to the context node of alv.

While configuring alv, for the first column "Hyperlink", you need to set the enabled fieldname as ENABLED attribute.

Sample:

while configuring alv:


          " Let us say you have hyperlink enditor as lo_hyperlink

               LO_HYPERLINK->SET_ENABLED_FIELDNAME( 'ENABLED').

While populating alv data

              


           if <<< your condition met >>>>

               ls_data-enabled = abap_true. " Enabling hyperlink

              

               else.

                    ls_data-enabled = abap_false. " Disabling hyperlink

               endif.

For more details, refer to the below blog

How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki

Hope this helps you.

Regards,

Rama

former_member220853
Participant
0 Kudos

Thanks a lot for your reply .This was really helpful

Answers (0)