Skip to Content
Former Member
Jun 28, 2012 at 08:53 AM

problems with SET_VARIANT of class CL_GUI_ALV_GRID


Hello mates,

I am using methods of class CL_GUI_ALV_GRID to display a list. First the program displays documents header data but our customer could chose some rows, press a buttom and see position information. As the information is different, output structures are different too.

After watching the information , they could press the same buttom and recover the header information.

To change between two outputs I use REFRESH_TABLE_DISPLAY. There isn´t any problem until here.

The customer could create or chose an output layout in header data list , after, press the buttom to see position information and then come back to header data. In these cases (when they have chosen a layout ) they want to see the header list (in this case ) with the layout that they have choosen in previous step. I try to get this using SET_VARIANT method (after getting in previous steps the layout with GET_VARIANT), but I haven´t got anything.

This is the part of the code where I call to this method

REFRESH gt_fieldcat.
PERFORM build_fieldcatalog USING ld_estructura.* refrescar el layout
CALL METHOD grid1->set_frontend_layout
is_layout = ge_layout.

CALL METHOD grid1->set_variant
is_variant = ls_variant
i_save = 'A'.

* refrescar el catalogo de campos
CALL METHOD grid1->set_frontend_fieldcatalog
it_fieldcatalog = gt_fieldcat.

* refrecar el informe
CALL METHOD grid1->refresh_table_display
is_stable = ls_stable
i_soft_refresh = space.

(in this call I have tried with different options but without any satisfactory result )

thanks for your help