Tag Archive ALV grid

Create ALV with class CL_SALV_TABLE

Example of implementation in SE38 : SALV_DEMO_TABLE_SELECTIONS.

Simply display ALV table


  DATA : go_alv_table TYPE REF TO CL_SALV_TABLE.

  TRY.
      cl_salv_table=>factory(
        IMPORTING
          r_salv_table = go_alv_table
        CHANGING
          t_table      = gt_table_to_display ).
    CATCH cx_salv_msg.
  ENDTRY.

  " Optimize columns width
  DATA(lo_columns) = go_alv_table->get_columns( ).
  lo_columns->set_optimize( ).

  " Apply zebra style to lv_rows
  DATA(lo_display) = go_alv_table->get_display_settings( ).
  lo_display->set_striped_pattern( cl_salv_display_settings=>true ).

Read More

Transport ALV Layout Variants

You can save your ALV layout variant in customising transport order with function module (SE37) : LT_VARIANTS_TRANSPORT.

In table T_VARIANTS, specify your report name (T_VARIANTS-REPORT) and variant name (T_VARIANTS-VARIANT) your want to transport.

Search tag: mise en forme, grille, variante

Demo programs for ALV Tree

Check theses programs using class CL_GUI_ALV_TREE:

SAPTLIST_TREE_CONTROL_DEMO
BCALV_TREE_DEMO
Read More

Set or change/delete user preference on ALV export

Use program : SALV_BS_ADMIN_MAINTAIN.

Create an ALV with FM REUSE_ALV_GRID_DISPLAY

Abap code example to display an ALV with FM REUSE_ALV_GRID_DISPLAY.

Read More

Create an ALV with custom control

You can check the SAP demo programs starting with BCALV_GRID_*

Read More

Simply display internal table into ALV grid

To display content of internal table into ALV grid, use this method :


  DATA : lo_table     TYPE REF TO cl_salv_table.

* Create ALV
  TRY.
      cl_salv_table=>factory(
        IMPORTING
          r_salv_table = lo_table
        CHANGING
          t_table      = gi_data_to_display ).
    CATCH cx_salv_msg.
  ENDTRY.

* Display ALV grid
  lo_table->display( ).

Example of use in SAP demo program : SALV_DEMO_TABLE_REAL_SIMPLE.

Read More