ALV with IDA(ALV on HANA)-7

alv-idaUsing SELECT_OPTIONS to display specific set of data.

 

 

 

Previous post Using PARAMETERS to display specific set of data displays data using parameters. This post shows how to set select-option to get records.

Code-


DATAlv_carrid TYPE sflightcarrid.
SELECT-OPTIONSs_carrid FOR lv_carrid.

DATAlr_salv TYPE REF TO if_salv_gui_table_ida,
      lr_range TYPE REF TO cl_salv_range_tab_collector.
cl_salv_gui_table_ida=>create(
  EXPORTING
    iv_table_name       =  ‘SFLIGHT’
  RECEIVING
    ro_alv_gui_table_ida lr_salv ).
CREATE OBJECT lr_range.
*Set the range
lr_range->add_ranges_for_nameiv_name   ‘CARRID’ it_ranges s_carrid[] ).
lr_range->get_collected_rangesIMPORTING et_named_ranges DATA(lt_ranges).

lr_salv->set_select_options(
  EXPORTING
    it_ranges    lt_ranges ).
* Display ALV
lr_salv->fullscreen)->display).


1

Output:

2

3


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s