2013 Jul 17 1:17 PM
Hi everybody,
I am using the oops ALV to display a report based on the some input data, for the first time the data is getting displayed correctly,
when the back button is pressed and the input data is changed the content displayed is not getting changed i am getting the previous content display only.
can anyone help me how to do display updated data in the ALV for the changed input data.
2013 Jul 17 4:26 PM
Hello, when you press BACK button, you have to free the objects relationed to ALV into the MODULE PAI
PROCESS AFTER INPUT.
MODULE user_command.
MODULE user_command.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE ..... -> Return to previous screen
* Free objects
go_grid->free( ). -> DATA: go_grid TYPE REF TO cl_gui_alv_grid.
go_custom_container->free( ).
-> DATA: go_custom_container TYPE REF TO cl_gui_custom_container.
* Clean objects
CLEAR: go_grid, go_custom_container.
ENDCASE.
ENDMODULE.
I hope this help you.
Regards
David Carballido
Hello, when you press BACK button, you have to free the objects relationed to ALV into the MODULE PAI
PROCESS AFTER INPUT.
MODULE user_command.
MODULE user_command.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE ..... -> Return to previous screen
* Free objects
go_grid->free( ). -> DATA: go_grid TYPE REF TO cl_gui_alv_grid.
go_custom_container->free( ).
-> DATA: go_custom_container TYPE REF TO cl_gui_custom_container.
* Clean objects
CLEAR: go_grid, go_custom_container.
ENDCASE.
ENDMODULE.
I hope this help you.
Regards
David Carballido
2013 Jul 17 3:45 PM
Try using "CHECK_CHANGED_DATA" to check if data is changed. Following link may be useful for you:
http://scn.sap.com/thread/3295165
Regards
2013 Jul 17 3:53 PM
Hi.
use this method
CALL METHOD gr_table->refresh
EXPORTING
s_stable = ld_stable
refresh_mode = if_salv_c_refresh=>soft.
Regards
Miguel
2013 Jul 17 4:22 PM
Hi,
Check Method REFRESH_TABLE_DISPLAY of Class CL_GUI_ALV_GRID.
You can see Demo Programs provided by SAP by going to SE38 and see programs starting with BCALV.
Thanks
Gaurav
2013 Jul 17 4:26 PM
Hello, when you press BACK button, you have to free the objects relationed to ALV into the MODULE PAI
PROCESS AFTER INPUT.
MODULE user_command.
MODULE user_command.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE ..... -> Return to previous screen
* Free objects
go_grid->free( ). -> DATA: go_grid TYPE REF TO cl_gui_alv_grid.
go_custom_container->free( ).
-> DATA: go_custom_container TYPE REF TO cl_gui_custom_container.
* Clean objects
CLEAR: go_grid, go_custom_container.
ENDCASE.
ENDMODULE.
I hope this help you.
Regards
David Carballido
2013 Jul 17 5:04 PM
Hi,
Few points to confirm.
1. Probably the output table is not cleared after each display. There must be some condition in your program like,
if it_data is initial.
fetch data.
endif.
If, so remove that condition.
If still not working, at start of selection, after the user inputs data, before fetching data from database, clear the data table.
start of selection.
clear it_data.
select .....
2. The call for ALV display should be something like this.
if CONT1 is initial.
create object cont1 exporting container_name = 'CONT1'.
create object grid1 exporting i_parent = CONT1.
call method grid1->set_table_for_first_display
exporting
i_structure_name = 'itab'
is_layout = s_layo
changing
it_outtab = it_data
it_fieldcatalog = it_fieldcat.
else.
call method grid1->refresh_table_display.
endif.
3. In the PAI, use this code to return to initial screen.
MODULE user_command.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE to screen 0.
2013 Jul 17 10:27 PM
try this code.
data : ref_grid type ref to cl_gui_alv_grid.
* to reflect the data changed into internal table
if ref_grid is initial.
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
importing
e_grid = ref_grid.
endif.
if not ref_grid is initial.
call method ref_grid->check_changed_data.
endif.
2013 Jul 18 7:23 AM
Hi,
Try using the method refresh_table_display of class cl_gui_alv_grid.
o_grid->refresh_table_display
Here o_grid is same as the ref which you are using for display the data.
2013 Jul 18 7:35 AM
Hi everyone,
i have solved the issue.
Both the answers given by Susmitha Susan Thomas and David Carballido worked for me.
By freeing the memory and by adding the refresh function worked for me.
Thanks for your instant replys.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |