cancel
Showing results for 
Search instead for 
Did you mean: 

Hotspot for selective cells in ALV

Former Member
0 Kudos

Hi Guys,

The requirement is something like this.

I have an ALV Grid where one of the columns is a checkbox. In my program, I'm making only a few of these checkboxes editable (using LVC_T_STYL). All the other columns are non-editable.

Now, I want an event to be triggered as soon as a user checks or unchecks the checkbox. Since I cannot assign a function code to this checkbox like in the case of a table-control, I have made this checkbox column a Hotspot.

The problem is that the hotspot appears even for those checkboxes which are disabled for input. The reason is that the HOTSPOT is a feature specified in the Field-Catalog and is supposed to be applicable for the entire column.

Is there a way that I can make the hotspot appear only when the checkbox is editable?

Or can you think of some other equally elegant (if not better) way of handling this scenario?

Regards,

Anand Mandalika.

P.S. I would also be glad to know how the fields STYLE2, STYLE3 and STYLE4 of the LVC_S_STYL are used.

Accepted Solutions (1)

Accepted Solutions (1)

ssimsekler
Active Contributor
0 Kudos

Hi Anand

You haven't been here for long. We feel your absence but you seem busy.

Anyways, I guess you have tried registering the event with

CALL METHOD gr_alvgrid->register_edit_event
     EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Does it still require to change the field to realize the change even for a checkbox? I remember, like Raja, that they've implemented so that checkbox fields do not require this.

However, if so, would you like to try putting buttons instead of checkboxes. This way the event is immediately triggered and you can do what you want (and if required set the checkbox) there.

And, I guess nobody has any idea on STYLE2 and others...

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Former Member
0 Kudos

Thanks a lot Raja and Serdar.

The solution worked perfectly!! And it is definitely much much more elegant than a hotspot.

I was under the impression that the <b>data_changed</b> event would get triggerred only after the user hits enter or tabs to another field. Obviously, this is not the case with a checkbox.

Perhaps I was a bit too lazy to think about this further and try it out: -).

And Serdar: thanks for your kind words. Yes, I have been away on a short vacation for 10 days. And after I came back I have been a bit busy with my work. But I hope I can make my presence felt in a few days' time :-).

Thanks a lot once again.

Regards,

Anand Mandalika.

P.S. After answering to queries for so long on this forum (not to mention pestering the guys who don't give points for the right answers ), I feel like asking an occassional question. So the next time I find myself too busy (or too lazy??), I shall post a question (which I hope doesn't sound too stupid) and get the chance to reward a few points to the Gurus of ABAP out here. Cheers!!

athavanraja
Active Contributor
0 Kudos

Hi Anand,

Are you also moderating this forum? i remember to have seen a post where you modified the post with "mark it as question" option.

Regards

Raja

Former Member
0 Kudos

Hi Raja,

Yes, I now have the moderator privileges for the SDN Forums. The SAP icon beside my name (in the forum posts) is an indication to that fact.

Regards,

Anand Mandalika.

Former Member
0 Kudos

What are moderator privileges?

Message was edited by: henry

athavanraja
Active Contributor
0 Kudos

Congrats Anand.

Regards

Raja

Former Member
0 Kudos

Raja, Henry, Serder, others,

I have a real concern with this approach (people actively moderating the forums - rewarding people points).

Check out my comments in the following (right at the end). Please post your comments here as well.

I think this should be debated some more before it is allowed to continue.

Brad

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

if you register the event DATA_CHANGED,

this would get triggered everytime u check or uncheck the check box. and based on the value 'X' or blank, you can take necessary action.

this way , the disabled check boxes will have no impact.

Regards

Raja