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

Choose Layout option in the selection screen

Hai Friends,

I am displaying my report in ALV. I want to give a Layout option in the selection screen as in FAGLL03. How can i do this?.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2009 at 03:14 PM

    Add the display variant as a parameter on the selection screen.and then call FM REUSE_ALV_VARIANT_F4 when the user presses F4 for the variant.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2009 at 10:34 AM

    HI,

    Firt create a parameter as shown below and then use a FM to get the values of the variants

    DATA  G_VARIANT      LIKE DISVARIANT.
    PARAMETERS P_VAR LIKE DISVARIANT-VARIANT.
    
    INITIALIZATION.
    G_VARIANT-REPORT = SY-REPID.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          IS_VARIANT                = G_VARIANT
         I_SAVE                    = 'A'
     IMPORTING
       ES_VARIANT                = G_VARIANT
     EXCEPTIONS
       NOT_FOUND                 = 1
       PROGRAM_ERROR             = 2
       OTHERS                    = 3
                .
      IF SY-SUBRC = 0.
        P_VAR = G_VARIANT-VARIANT.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    In your FM REUSE_ALV_GRID_DISPLAY, pass G_VARIANT to the parameter IS_VARIANT of the FM.
    

    Hope this helps.

    Regards,

    Sachin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2009 at 10:56 AM

    Steps are as follows :

    1. On selection screen create the parameter :

    SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME TITLE text-021.

    *-- Parameters for ALV display

    PARAMETERS: p_layout TYPE variant.

    SELECTION-SCREEN END OF BLOCK blk3.

    2. Attach F4 help to this parameter using FM

    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

    EXPORTING

    is_variant = gw_alv_variant

    i_save = 'A'

    IMPORTING

    es_variant = gw_alv_variant

    EXCEPTIONS

    not_found = 1

    program_error = 2

    OTHERS = 3.

    3. Set this layout for initial display of ALV . Otherwise there is no meaning to use the layout option.

    *-- Set Layout

    CALL METHOD go_layout->set_initial_layout

    EXPORTING

    value = p_layout .

    Hope it helps you.

    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.