OO ALV Variants
I have a program with two ALVs on two separate subscreens on two tabs. The problem is that I'm allowing the user to save their own variants using the following code:
call method grid1->set_table_for_first_display exporting i_save = 'A' is_variant = gs_variant is_layout = gs_layout changing it_fieldcatalog = gt_fieldcat it_sort = gt_sort it_outtab = g_case_control_itab.
CALL METHOD alvgrid_wfdoc_m->set_table_for_first_display EXPORTING is_layout = alvlout_wfdoc_m is_variant = alvvari_wfdoc_m i_save = 'A' CHANGING it_fieldcatalog = alvfcat_wfdoc_m it_outtab = g_tbl_mtratch it_filter = alvfilt_wfdoc_m.
In both cases I'm only passing the field sy-repid to the structure is_variant and the upshot of this is that changing one variant on one screen changes the other as the program is unable to distinguish between the two.
So, I've worked out that I need to fill more fields in the variant structure, the following fields are available:
REPORT - already filling this
Can anyone tell me which fields I need to populate to get two separate lists of variants for each alv? So I can maintain one variant on one screen and not affect anything on the second screen? Each screen has completely different fields.