Advertisement
depth1

ALV quick

Feb 13th, 2019
1,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.09 KB | None | 0 0
  1.     DATA:
  2.       lo_table     TYPE REF TO cl_salv_table,
  3.       lo_functions TYPE REF TO cl_salv_functions_list.
  4.  
  5.     CALL METHOD cl_salv_table=>factory(
  6.       IMPORTING
  7.         r_salv_table = lo_table
  8.       CHANGING
  9.         t_table      = lt_vals ).
  10.  
  11.     lo_functions = lo_table->get_functions( ).
  12.     lo_functions->set_all( 'X' ).
  13.  
  14.     lo_table->display( ).
  15.  
  16. * Entête
  17.   data:
  18.     lo_layout    type ref to cl_salv_form_layout_grid,
  19.     lo_label     type ref to cl_salv_form_label.
  20.  
  21.   create object lo_layout.
  22.  
  23.   lo_label = lo_layout->create_label( row = 1 column = 1 ).
  24.   lo_label->set_text( 'entête!' ).
  25.   lo_table->set_top_of_list( lo_layout ).
  26.  
  27. * Colonnes
  28.   data:
  29.     lo_columns      type ref to cl_salv_columns_table,
  30.  
  31.   lo_columns = lo_table->get_columns( ).
  32.   lo_columns->set_optimize( abap_true ).
  33.   lo_columns->get_column('NEWKEY')->set_long_text('Nouvelle clef').
  34.   lo_columns->get_column('ISEXIST')->set_long_text('Existe ?').
  35.   lo_columns->get_column('SEQNO')->set_long_text('N°').
  36.  
  37.   call method lo_columns->set_color_column
  38.     exporting
  39.       value = 'COLOR'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement