ALV Title & Row Pattern Setting
Method: DISPLAY_OPTIONS of interface IF_SALV_GUI_TABLE_IDA can be used to set alv title and row ppatern.
The method DISPLAY_OPTIONS returns am object of IF_SALV_GUI_TABLE_DISPLAY_OPT which provides methods to set the title and row pattern.
Program without alv title and row pattern.
Code:
DATA: lr_salv TYPE REF TO if_salv_gui_table_ida,
lr_disp TYPE REF TO if_salv_gui_table_display_opt.
cl_salv_gui_table_ida=>create(
EXPORTING
iv_table_name = ‘SFLIGHT’
RECEIVING
ro_alv_gui_table_ida = lr_salv ).
* Get display option reference
lr_disp = lr_salv->display_options( ).
* Set the title
lr_disp->set_title( iv_title = ‘Flight Information’ ).
* Set zebra pattern
lr_disp->enable_alternating_row_pattern( ).
* Display ALV
lr_salv->fullscreen( )->display( ).
Output- ALV title set and Row Pattern(ZEBRA).