‎2013 Jun 12 10:06 AM
Hello Experts,
I have an Grid ALV created in OOPS.
Now, i have created a button on the application toolbar of the ALV for refreshing the vales. (i.e. Some fields were changed after calling a change transaction and i need to refresh my internal table to get them displayed)
So, on handle_user_command event for the ALV,
i have the following coding,
CASE e_ucomm.
WHEN 'REFRESH_GRID'.
SUBMIT ztest USING SELECTION-SETS OF PROGRAM 'ztest'.
ENDCASE.
Now, my report is being called and executed but select-options are not being used, hence ALV is displayed blank.
I have also tried :
SUBMIT ztest WITH p_id = p_id VIA SELECTION-SCREEN.
(P_ID is the only parameter i have on my selection-screen)
Then report is being and selection screen is automatically filled but how can i make it to execute as well.
I tried
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = 'ONLI'.
But it does not work.
Help Appreciated.
Regards,
Rajat Bothra
‎2013 Jun 12 10:45 AM
Hi,
you would like to call again your program just for a refresh button ???
Regards
Fred
‎2013 Jun 12 10:45 AM
Hi,
you would like to call again your program just for a refresh button ???
Regards
Fred
‎2013 Jun 12 11:00 AM
Thanks Fred. But after posting, i myself tried this
WHEN 'REFRESH_GRID'.
PERFORM get_data. " Get data from DB table again
CALL METHOD r_GRID->REFRESH_TABLE_DISPLAY.
and it worked.
i should have tried more before posting maybe.
This option didn't strike me till now.
Closing the post now.
‎2013 Jun 12 11:04 AM
On user command, you just have to call REFRESH_TABLE_DISPLAY method of CL_GUI_ALV_GRID class. Submit report is not a good way of refreshing display.
‎2013 Jun 12 11:10 AM
‎2013 Jun 12 11:41 AM
just use these codes to refresh the alv:
DATA: go_grid TYPE REF TO cl_gui_alv_grid.
CALL METHOD go_grid->refresh_table_display.
Regards,
Ikrar
‎2013 Jun 12 2:06 PM
Structure a little your repor, should look like
* some forms executed after start-of-selection
START-OF-SELECTION.
PERFORM load_data.
PERFORM build_final_table.
PERFORM display_data.
* In the "user_command" of the screen
CASE ok_code.
WHEN 'REFRESH_GRID'.
PERFORM load_data.
PERFORM build_final_table.
lr_grid->refresh_table_display(
EXPORTING
is_stable = is_stable
i_soft_refresh = i_soft_refresh ).
WHEN 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
* etc.
ENDCASE.Regards,
Raymond