ALV with IDA(ALV on HANA)-5

alv-ida

Controlling Aggregation, Filtering & Sorting in ALV

 

 

General actions like aggregation(total), filtering & sorting is automatically enabled for the fields and obviously aggregation of the fields with relevant data type. It is also possible to disable all the actions on the particular column(s) as per needed by using the methods of the IDA interface IF_SALV_GUI_FIELD_CATALOG_IDA 

17.jpg

A simple program.

16.jpg

Output: Right click on the CONNID field & choose the option – Group.

1

It groups all records based on the particular CONNID value.

2

Ungroup it.

3

Filtering on the PLANETYPE column.

4

Press F4 and it lists all the distinct planetype value. Choose one.

5

Continue.

6

Now the list is filtered out.

7

Also Aggregation(Total).

8

It SUMS the column value.

9

Sorting on the CARRID column.

10

List sorted.

11

Code: To disable Aggregation, Filtering and sorting on few columns.


DATAlr_salv TYPE REF TO if_salv_gui_table_ida.
DATAlr_fcat TYPE REF TO if_salv_gui_field_catalog_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.
* Get the field catalog reference
lr_fcat lr_salv->field_catalog).
lr_fcat->disable_sortiv_field_name ‘CARRID’  ).
lr_fcat->disable_filteriv_field_name ‘PLANETYPE’ ).
lr_fcat->disable_aggregationiv_field_name ‘SEATSMAX’ ).
* Display ALV
lr_salv->fullscreen)->display).


 

12

Output:

Sorting Disabled on CARRID column.

13

Filtering disabled on PLANETYPE column.

14

Aggregation disabled on SEATSMAX column.

15


 

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 )

Facebook photo

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

Connecting to %s