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: 

OO ALV Variants

Former Member
0 Kudos

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.

and


    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

HANDLE

LOG_GROUP

USERNAME

VARIANT

TEXT

DEPENDVARS

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.

Thanks!

3 REPLIES 3

0 Kudos

Hi!

I´m not sure to have understood your question very well, but, if I am in the certain, but I think that you want to execute a report with an ALV using a variant. In this mode, you have to save the name of the variant you want to use, in the field VARIANT. When you have an alv, you can SAVE a variant using the corresponding buttons, then, when you have the variant, you can execute de ALV using the variant created.

I hope that my information have been useful to you.

Very Lucky in your Report.

0 Kudos

No, that's not what I meant, sorry I didn't explain it better. I've solved the problem myself by adding the field HANDLE = 1 and HANDLE = 2 to my two ALV grids. This means that everytime a user retrieves, changes or saves a variant it saves it with a unique key for that screen.

0 Kudos

Oh,

I am glad for you