08-17-2011 9:45 PM
Hello ,
I have developed an ALV grid report using OOPS.
I have placed some check boxes in my output display. After the report is displayed for 1st time, the user will check some check boxes and continue further proceesing.
Can some one tell me how do i trap the value of which check boxes have been checked(or unchecked). Which event do i need
to use?
Thanks
Ricky
08-17-2011 9:55 PM
Hi
The event is the same event to get all fields having the value changed: DATA_CHANGED
Max
08-17-2011 10:06 PM
Hi Max,
I am using that event. For some reason my event is not getting triggered.
I am clicking oin the check box but the value is not getting updated in the internal table for the check box.
Can you please tell me where i may be wrong.
My code:
it_final : is the internal table displayed on ALV with 1st field for check box values. Its showing empty.
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
refresh_changed_data for event data_changed of cl_gui_alv_grid importing er_data_changed
e_ucomm sender,
ENDCLASS.
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD refresh_changed_data.
data : ls_modified type lvc_s_modi,
ls_stable type lvc_s_stbl,
lv_field(10) type c.
clear: ls_stable-row, ls_stable-col.
loop at er_data_changed->mt_mod_cells into ls_modified.
clear wa_final.
read table it_final into wa_final index ls_modified-row_id.
if sy-subrc eq 0.
wa_final-process = ls_modified-value.
modify it_final from wa_final index ls_modified-row_id.
endif.
ls_stable-row = 'X'.
ls_stable-col = 'X'.
grid->refresh_table_display( exporting is_stable = ls_stable ).
endloop.
endmethod.
<Added code tags>
Moderator Message: Please use "code" tags when pasting a code snippet
Edited by: Suhas Saha on Aug 18, 2011 9:28 AM
08-17-2011 10:53 PM
08-17-2011 11:12 PM
Yes Max,
I am using it before at the time user clicks on the button my user command as below:
set handler g_handler->refresh_changed_data for grid.
ls_stable-row = 'X'.
ls_stable-col = 'X'.
grid->refresh_table_display( exporting is_stable = ls_stable ).
call method grid->check_changed_data.
Am i triigering it in the right place . Pls correct.
<Added Code tags>
Edited by: Suhas Saha on Aug 18, 2011 9:29 AM
08-18-2011 12:06 AM
Hi
The event should be triggered only if you do something, press a button
Max
08-18-2011 1:26 AM
Max, I forgot to mention that the button is NOT part of the ALVE grid tool bar.
Its placed on the screen outside of ALV grid.
Is that why ist not triggering my event?
Pls suggest.
Thanks
Ricky
08-18-2011 7:36 AM
Try to call the methd CHECK_CHANGED_DATA in tha user_command of you pai
Max
08-19-2011 1:12 PM
Max,
The events data_changed..etc are working only if i place my button inside ALV tool bar.
Any clues??
Thanks
08-21-2011 7:27 PM
For some reason if i try placing the button in ALV toolbar the its working. But this is not a perfect answer