Restricting maximum number of rows in alv.
The previous post Simple first ALV with IDA shows how to display alv with IDA.This post describes how to restrict the maximum number of rows to display.
Code:
DATA: lr_salv TYPE REF TO if_salv_gui_table_ida.
TRY.
cl_salv_gui_table_ida=>create(
EXPORTING
iv_table_name = ‘SFLIGHT’
RECEIVING
ro_alv_gui_table_ida = lr_salv ).
CATCH cx_salv_db_connection.
CATCH cx_salv_db_table_not_supported.
CATCH cx_salv_ida_contract_violation.
ENDTRY.
* Set maximun rows to display
TRY.
lr_salv->set_maximum_number_of_rows(
EXPORTING
iv_number_of_rows = 10 ).
CATCH cx_salv_param_out_of_bounds.
ENDTRY.
* Display ALV
lr_salv->fullscreen( )->display( ).
OUTPUT: