Application Development 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: 

Change of Field Catalogue in handle_data_changed Event Method of ALV Grid

naresh_vvsr
Employee
Employee
0 Kudos
415

Dear Experts.

I have a use case, where I would like to make some columns appear/disappear on press of an enter. And I have programmed the enter event, using a method called 'handle_data_changed'.

But when is use the following to make the coloumns appear/disappear inside the handle_data_changed method, none of these below work at all.

          CALL METHOD g_grid->set_frontend_fieldcatalog

            EXPORTING

              it_fieldcatalog = gt_fcat.



          CALL METHOD g_grid->get_frontend_layout

            IMPORTING

              es_layout = gs_layout.

Is the reason behind this a auto refresh of gt_outtab running after the method : handle_data_changed ?

What would the solution this use case ?

Regards,

Naresh

6 REPLIES 6

Former Member
0 Kudos
72

Hope you are calling the method for displaying the ALV after this code or refreshing the ALV display .

Can you put the code . That will help in analyzing the issue more closely .

Thanks

Manik

0 Kudos
72

Hi,

As you know we cannot use REFRESH_TABLE_DISPLAY method inside event method for handle_data_changed. As the ALV standard say's the refresh is taken care automatically. This why I am not sure is really the refresh happens, also I tried using the refresh method I get a runtime warning message saying 'not to use'.

Regards,

Naresh

former_member210252
Contributor
0 Kudos
72

Hi Naresh,

Are you using refresh method call method g_grid->REFRESH_TABLE_DISPLAY.


If not using it in your development, please use it and see.

Regards,

Rafi

0 Kudos
72

Hi,

As you know we cannot use REFRESH_TABLE_DISPLAY method inside event method for handle_data_changed. As the ALV standard say's the refresh is taken care automatically. This why I am not sure is really the refresh happens, also I tried using the refresh method I get a runtime warning message saying 'not to use'.

Regards,

Naresh

0 Kudos
72

Hi Naresh,

Could you please try with the below to handle changed data from ALV to Internal table.

DATA: gv_ref1 TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

    IMPORTING

      e_grid = gv_ref1.

  CALL METHOD gv_ref1->check_changed_data.

Regards,
Venubabu Divvi

former_member555112
Active Contributor
0 Kudos
72

Hi,

After the set_frontend_fieldcatalog call

call method cl_gui_cfw=>flush

         exceptions

           cntl_system_error = 1

           cntl_error        = 2

           others            = 3.

       if sy-subrc <> 0.

         message id sy-msgid type sy-msgty number sy-msgno

                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

       endif.



Regards,

Ankur Parab