"
Supported by

How to resize an ALV grid to fill the whole window

Sometimes the simplest things take the longest time to do. For instance, we recently needed an ALV grid to automatically resize to fill the whole window. But how? But how? But how?

In the container’s properties, just check these two attributes: horizontal and vertical resizing.

It’s simple. But not at all obvious.

Thank you Daniel Campos for the tip.

Greetings from Abapinho.

2 comentários a “How to resize an ALV grid to fill the whole window”

  1. Pedro Diz:

    Olá! Se fizeres desta forma não será necessário desenhar um contêiner:

    data: lo_splitter TYPE REF TO cl_gui_splitter_container,
    lo_container TYPE REF TO cl_gui_container,
    go_alv TYPE REF TO cl_gui_alv_grid.

    IF go_alv IS INITIAL.

    *– Prepara o container
    CREATE OBJECT lo_splitter
    EXPORTING
    parent = cl_gui_container=>default_screen
    rows = 1
    columns = 1
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    OTHERS = 3.

    IF sy-subrc IS INITIAL.
    *– Pega a linha e a coluna do container selecionado
    CALL METHOD lo_splitter->get_container
    EXPORTING
    row = 1
    column = 1
    RECEIVING
    container = lo_container.
    ENDIF.

    CREATE OBJECT go_alv
    EXPORTING
    i_parent = lo_container
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    OTHERS = 5.

    endif.

  2. Nuno Godinho Diz:

    Obrigado pela sugestão Pedro. Bem mais simples! Acho que vou fazer um artigo sobre isso em breve ;-)

Deixe um comentário


About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).