You are on page 1of 2

REPORT Z46149185_ALV_IDA2.

data o_range_coll type REF TO CL_SALV_RANGE_TAB_COLLECTOR.


data v_vbeln type z46149185VBAK-vbeln.
data o_alv type REF TO IF_SALV_GUI_TABLE_IDA.
data o_full_screen type REF TO IF_SALV_GUI_FULLSCREEN_IDA.
data o_fcat type REF TO IF_SALV_GUI_FIELD_CATALOG_IDA.

select-OPTIONS s_vbeln for v_vbeln default '4969' to '4970'.

CL_SALV_GUI_TABLE_IDA=>create_for_cds_view(
EXPORTING
iv_cds_view_name = 'ZCDS185'
* io_gui_container =
* io_calc_field_handler =
RECEIVING
ro_alv_gui_table_ida = o_alv
).
*CATCH cx_salv_db_connection. " Error connecting to database
*CATCH cx_salv_db_table_not_supported. " DB table / view is not supported
*CATCH cx_salv_ida_contract_violation. " IDA API contract violated by caller
*CATCH cx_salv_function_not_supported. " Funcionality is not supported

o_full_screen = o_alv->fullscreen( ).
*Collect the FullScreen Obj
*CATCH cx_salv_ida_contract_violation. " IDA API contract violated by caller

o_fcat = o_alv->field_catalog( ).
*Get the fcat Obj from ALV Obj

o_fcat->set_field_header_texts(
EXPORTING
iv_field_name = 'PRTY'
iv_header_text = text-001
* iv_tooltip_text =
* iv_tooltip_text_long =
).

o_alv->display_options( )->enable_alternating_row_pattern( ).
o_alv->display_options( )->set_title( iv_title = 'Sales order details').

create OBJECT o_range_coll.


o_range_coll->add_ranges_for_name(
EXPORTING
iv_name = 'VBELN'
it_ranges = S_VBELN[]
).

o_range_coll->get_collected_ranges(
IMPORTING
et_named_ranges = data(it_ranges)
).

o_alv->set_select_options(
EXPORTING
it_ranges = it_ranges
* io_condition =
).
*CATCH cx_salv_ida_associate_invalid. " Superclass for all dynamic ALV IDA
exceptions
*CATCH cx_salv_db_connection. " Error connecting to database
*CATCH cx_salv_ida_condition_invalid. " Superclass for all dynamic ALV IDA
exceptions
*CATCH cx_salv_ida_unknown_name. " Unknown name: FieldName,DataElementName,...
o_full_screen->display( ).

You might also like