title: Enable standard toolbar for ALV grid
body: <p>I created a screen for displaying ALV output but I am not able to show standard toolbar buttons (save, exit, back, etc.).</p>
  
  <p>Can any one suggest how to enable them?</p>
  
  <pre><code>DATA: it_zztstudent type STANDARD TABLE OF zztstudent,
        it_fcat TYPE STANDARD TABLE OF lvc_s_fcat,
        i_selected_rows TYPE lvc_t_row,
        w_selected_rows type lvc_s_row,
        it_modified type STANDARD TABLE OF zztstudent,
        lw_modified type zztstudent,
        lw_zztstudent type zztstudent,
        w_variant   TYPE disvariant,
        o_docking type REF TO cl_gui_docking_container,
        o_grid type ref to cl_gui_alv_grid.
  
  FIELD-SYMBOLS: &lt;fs_fieldcat&gt; type lvc_s_fcat.
  tables: zztstudent.
  select-OPTIONS: sst_id for zztstudent-st_id.
  select * from zztstudent
       into table it_zztstudent
       where st_id in sst_id.
  if sy-subrc NE 0.
     message e001(zmsgpr).
  ENDIF.
  
  call screen 9000.
  
  module status_9000 OUTPUT.
     if o_docking is initial.
       set PF-STATUS 'ZSTATUS'.
       set titlebar 'ZTITLE'.
     "Creating Docking Container and grid
     PERFORM create_object.
     "filling the fieldcatalog table
     PERFORM create_fieldcat.
     "Modifying the fieldcatalog table
     PERFORM modify_fieldcat.
     "Registering edit
     PERFORM register_edit.
     "displaying the output
     PERFORM display_output.
    ENDIF.
  endmodule.
  
  MODULE user_command_9000 INPUT.
    Data: lv_ucomm TYPE sy-ucomm.
    lv_ucomm = sy-ucomm.
    CASE lv_ucomm.
      WHEN 'CANCEL' oR 'EXIT'.
        PERFORM free_objects.
        leave program.
      WHEN 'BACK'.
        PERFORM free_objects.
        SET SCREEN '0'.
        leave SCREEN.
      WHEN 'SAVE'.
        PERFORM save_database.
         CALL METHOD o_grid-&gt;refresh_table_display.
    ENDCASE.
  
  ENDMODULE.
  Form create_object.
    "create docking container
    create object o_docking
        exporting
            ratio = '95'.
    if sy-subrc eq 0.
      "create grid
      create OBJECT o_grid
         exporting
           i_parent = o_docking.
    endif.
  ENDFORM.
  
  FORM create_fieldcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
     EXPORTING
  *     I_BUFFER_ACTIVE              =
       I_STRUCTURE_NAME             =  'ZZTSTUDENT'
  *     I_CLIENT_NEVER_DISPLAY       = 'X'
  *     I_BYPASSING_BUFFER           =
  *     I_INTERNAL_TABNAME           =
      CHANGING
        CT_FIELDCAT                  = IT_FCAT
     EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
              .
    IF SY-SUBRC &lt;&gt; 0.
  * Implement suitable error handling here
    ENDIF.
    ENDFORM.
  "making the column as editable
  FORM modify_fieldcat.
     loop at it_fcat ASSIGNING &lt;fs_fieldcat&gt;.
       CASE &lt;fs_fieldcat&gt;-fieldname.
        WHEN 'ST_NAME'.
          &lt;fs_fieldcat&gt;-edit = 'X'.
          WHEN 'ST_CITY'.
          &lt;fs_fieldcat&gt;-edit = 'X'.
       ENDCASE.
     ENDLOOP.
  ENDFORM.
  
  FORM register_edit.
    call METHOD o_grid-&gt;register_edit_event
       exporting
          i_event_id = cl_gui_alv_grid=&gt;mc_evt_modified.
  ENDFORM.
  
  FORM display_output.
     w_variant-report = sy-repid.
     call METHOD o_grid-&gt;set_table_for_first_display
         EXPORTING
              is_variant = w_variant
              i_save     = 'A'
         CHANGING
              it_outtab  = it_zztstudent
              IT_FIELDCATALOG = it_fcat
         EXCEPTIONS
              invalid_parameter_combination = 1
              program_error = 2
              too_many_lines = 3
              others = 4.
     if sy-subrc &lt;&gt; 0.
       message e001(zmsgpr).
     endif.
  ENDFORM.
  
  FORM free_objects.
    call method o_grid-&gt;free
       EXCEPTIONS
          cntl_error = 1
          cntl_system_error = 2
          others = 3.
    if sy-subrc &lt;&gt; 0.
      message e001(zmsgpr).
    endif.
  
    call method o_docking-&gt;free
       EXCEPTIONS
         cntl_error = 1
         cntl_system_error = 2
         others = 3.
    if sy-subrc &lt;&gt; 0.
       message e001(zmsgpr).
    endif.
  
  ENDFORM.
  </code></pre>