2007 Jun 25 2:22 PM
Hi experts,
I am facing a problem in refreshing the internal table in ALV. I am displaying records of internal table with checkbox. user can select one or more records and then presses delete button. I have written code in User command form to delete the selected records.
In the internal table it has deleted the selected records. but when alv is displayed again it is displaying old internal table records( all records).
Sample code in user command subroutine.
loop at itab where checkbox = 'X'.
delete itab index sy-tabix.
endloop.
Let know what needs to be done. points will be awarded for helpful answers.
2007 Jun 25 2:27 PM
If you are using the function module ALV, you need to set the REFRESH flag in the USER_COMMAND routine. HEre is an example.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'HANDLE_USER_COMMAND'
it_fieldcat = ifc
tables
t_outtab = itab.
endform.
***********************************************************************
* FORM handle_User_Command *
***********************************************************************
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
* DO Something
rs_selfield-refresh = 'X'.
endcase.
endform.
Regards,
RIch Heilman
If you are using the function module ALV, you need to set the REFRESH flag in the USER_COMMAND routine. HEre is an example.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'HANDLE_USER_COMMAND'
it_fieldcat = ifc
tables
t_outtab = itab.
endform.
***********************************************************************
* FORM handle_User_Command *
***********************************************************************
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
* DO Something
rs_selfield-refresh = 'X'.
endcase.
endform.
Regards,
RIch Heilman
2007 Jun 25 2:24 PM
Hello
At the end of the USER_COMMAND routine set <b>REFRESH = 'X'.</b>
Regards
Uwe
2007 Jun 25 2:27 PM
If you are using the function module ALV, you need to set the REFRESH flag in the USER_COMMAND routine. HEre is an example.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'HANDLE_USER_COMMAND'
it_fieldcat = ifc
tables
t_outtab = itab.
endform.
***********************************************************************
* FORM handle_User_Command *
***********************************************************************
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
* DO Something
rs_selfield-refresh = 'X'.
endcase.
endform.
Regards,
RIch Heilman
2007 Jun 25 2:28 PM
Hi,
In ALV, to refresh the table you have to call the method "refresh_table_display".
It has the syntax very similar to creating the table.
It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
or
if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).
the synatx is :-
call method grid (name of grid )->refresh_table_display
exporting
IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)
I_SOFT_REFRESH = <VARIABLE OF CHAR 01> (THIS IS FOR ICON REFRESHING).
Regards,
Bhaskar
2007 Jun 25 3:08 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |