title: How to make a table size on grid like a container size in ABAP
body: <p>I need help with ABAP alv_grid.</p>
  
  <p>First, I'll show you my code:</p>
  
  <pre><code> "descibe data
    data: grid            type ref to cl_gui_alv_grid,
          container       type ref to cl_gui_custom_container,
   "create a container
      if container is initial.
          container = new cl_gui_custom_container(                    =
              container_name              = 'CONTAINER'
      *        lifetime                    = LIFETIME_DEFAULT
  
          ).
  "create a grid
  if grid is initial.
      grid = new cl_gui_alv_grid( i_parent = container ).
  
  
  call method grid-&gt;set_table_for_first_display
        exporting
         is_layout            = wa_layout
         it_toolbar_excluding = gt_toolbar_excluding
  
        changing
          it_outtab            = lt_variable
          it_fieldcatalog      = it_fcat.
  </code></pre>
  
  <p>As a result I have something like <a href="https://i.stack.imgur.com/tPaIH.png" rel="nofollow noreferrer">this</a> (red lines on a picture is what exactly I need to get in final).</p>
  
  <p>My target is to make a table size like a container size and I don't know where I should add a parameter to reach this goal (if this is possible).</p>
  
  <p>P.S. if it's necessary, the layout is:</p>
  
  <pre><code>  data wa_layout TYPE lvc_s_layo.
    wa_layout-cwidth_opt = 'X'.
  </code></pre>