cancel
Showing results for 
Search instead for 
Did you mean: 

How to use On click on cell event in Webdynpro ABAP ALV?

gopalkrishna_baliga
Participant
0 Kudos
2,210

Hi Experts,

    I have a webdynpro ABAP ALV report. In the ALV table there are 2 columns: CarrierCode and CarrierName.

    CarrierCode column is editable and CarrierName is display only.

    When the user changes CarrierCode entry and places the cursor to the next cell, the CarrierName value must be updated ( using select query on a table)  immediately. I have tried ON_CLICK event handler but it does not get triggered when I click on next cell.

The definition of ON_CLICK is as below:

ON_CLICK    After Click in Cell of ALV Output

So it should have worked. What could be the problem?

I have tried ON_DATA_CHECK and it triggers only when I press enter. In my case users want to update the CarrierName when next cell is clicked without any enter press. Note that I don't have any buttons in any of the ALV cells.

Kindly help.

Thanks

Gopal

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

either make first field as drop-down then you can write code in on_select

or if its input field then you have to write code in on_enter and to trigger this you must hit enter..

so i will suggest you to make it ddbk..

.. Chandra..

0 Kudos

Hi ,

You can achieve through ON_CELL_ACTION event.

call the event at the time defining alv as below:

if_salv_wd_setting~set_cell_action_event (abap_true )

Rest will be the same as you doing for other alv events.

Here the ON_CELL_ACTION event will triggerd when your changing the carrier code or clicking any of the cell editor in alv.

Here you will column as one of the parameter in R_PARAM, Her u will get the respective whatever column you need, for ur case it will be carrier code.

By this u will achieve your requirement, by passing respecitive carrier code to get carrier name and resetting the whole alv table.

Hope this will be helpful.

gopalkrishna_baliga
Participant
0 Kudos

Hi Saravanan,

    Are you sure about your suggestion?

 

   The below code syntax you have given is incorrect.

    if_salv_wd_setting~set_cell_action_event (abap_true )

   I have already tried ON_CELL_ACTION using lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled

   but this event also triggers after I press "Enter".

   Even the link below confirm the same.

  http://wiki.sdn.sap.com/wiki/display/WDABAP/How+to+trigger+the+event+ON_CELL_ACTION+in+ALV

  Kindly correct me if  I am wrong. Send the correct code syntax if you have. Do we need to write the code in a specific webdynpro method like wddoinit? That will be really helpful.

Thanks

Gopal

0 Kudos

Hi Gopal,

its just typo error, hope ur familiar with the syntax as below.

if_salv_wd_table_settings~set_cell_action_event_enabled( abap_true ).

The above should be declared in method where you are instantiating  the ALV (Component & table) settings as like the other alv properties.

Then on cell action code should be written in any of the  separate webdynpro method with type event handler, but in the same view where you are displaying the alv table,..for example

as what we are doing for ON_FUNCTION event for all alv toolbar button functions, hope ur familiar with this.

Thanks.

gopalkrishna_baliga
Participant
0 Kudos

Hi Saravanan,

   i think you did not get my question.

   I have tried ON_CELL_ACTION and it does not get triggered when I just click on some other cell.

   ON_CELL_ACTION gets triggered only after I press "Enter" button in a cell.

   But I don't want that. What i want is. when I change content of a cell and click on some other cell then event should trigger.

  Therefore ON_CELL_ACTION will not work for me. Please confirm.

Thanks

Gopal

Former Member
0 Kudos

Hi Gopal,

There is no such event which will be triggered when you click on the field.

ONENTER event is triggered when you enter value inside the field and press enter.

Kiran_Valluru
Active Contributor
0 Kudos

Hi,

ON_CLICK event is for cell editor of type link_to_action. You have to press enter to update the data in the second column.

Or make the first column drop down and in OnSelect of drop down update the second column.

Regards,

Kiran