Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV OOPS - Calling same program again with same selection screen

Former Member
0 Likes
846

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

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
792

Hi,

you would like to call again your program just for a refresh button ???

Regards

Fred

6 REPLIES 6
Read only

FredericGirod
Active Contributor
0 Likes
793

Hi,

you would like to call again your program just for a refresh button ???

Regards

Fred

Read only

0 Likes
792

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.

Read only

Former Member
0 Likes
792

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.

Read only

former_member209120
Active Contributor
0 Likes
792

This message was moderated.

Read only

Former Member
0 Likes
792

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
792

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