Skip to Content
author's profile photo Former Member
Former Member

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.

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 02:32 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.