Skip to Content

apply different layout

hello all,i am facing a problem now:i develop an ABAP report program,with 3 radio buttons on selection screen,output 3 lists correspondingly,they get different fields,now if i config a userlayout for one output list,and set it as default layout for all users,this layout will apply to another two lists,how can i make it as list -specific for all users?i tried to create 3 GUIs,but it failed,any suggestion will be appreciate.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 14, 2010 at 11:08 AM

    Add a "handle" in your variant (structure DISVARIANT, field handle) use a different handle value for each list, so you can have 3 different default layouts, and layouts are related to one list.

    ls_variant-report = sy-repid.
    IF radio1 EQ c_x.
      ls_variant-handle = '0001'.
    ELSEIF radio2 EQ c_x.
      ls_variant-handle = '0002'.
    ELSEIF radio3 EQ c_x.
      ls_variant-handle = '0003'.
    ENDIF.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

    • I supposed you use ALV (OO, LVC or REUSE FM) all those objects have parameters to manage display variants : look for IS_VARIANT and I_SAVE, the code above was intended to be used to fill IS_VARIANT parameter :

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
      (...)
                i_save     = lv_save
                is_variant = ls_variant
      (...)

      or

      CALL METHOD alv->set_table_for_first_display
        EXPORTING
      (...)
          is_variant                    = ls_variant
          i_save                        = lv_save
      (...)

      The use of handle allow management of many different ALV layouts in a single program.

      Regards,

      Raymond

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.