‎2009 Mar 25 3:36 PM
Hi. I am running the following code:
TRY.
lr_aggr = lr_aggrs->get_aggregation( columnname = 'SEATSMAX' ).
CATCH cx_salv_not_found INTO gr_error.
ENDTRY.
TRY.
lr_aggr->set( aggregation = if_salv_c_aggregation=>maximum ).
CATCH cx_salv_data_error INTO gr_error.
ENDTRY.
The lr_aggr->set( aggregation = if_salv_c_aggregation=>maximum ) is failing because I am not getting a good reference from the lr_aggr = lr_aggrs->get_aggregation( columnname = 'SEATSMAX' ) method above. All of my prior references are ok because I am doing other methods against the same ALV grid, but for some reason, the AGGREGATION is not working.
Can anyone see anything that I might be doing wrong?
Thank you!
Andy
‎2009 Mar 25 3:44 PM
Hi Andy,
Yup it is wrong. Use the code below:
data: lr_aggr TYPE REF TO cl_salv_aggregations,
lr_salv TYPE REF TO cl_salv_table.
lr_aggr = lr_salv->get_aggregations( ).
lr_aggr->add_aggregation( 'SEATSMAX' ).
This will work:)
Regards
Marcin
‎2009 Mar 25 3:44 PM
Hi Andy,
Yup it is wrong. Use the code below:
data: lr_aggr TYPE REF TO cl_salv_aggregations,
lr_salv TYPE REF TO cl_salv_table.
lr_aggr = lr_salv->get_aggregations( ).
lr_aggr->add_aggregation( 'SEATSMAX' ).
This will work:)
Regards
Marcin
‎2009 Mar 25 3:48 PM
HI,
Refer to the demo program SALV_TEST_TABLE
lr_aggregations = gr_table->get_aggregations( )