In SALV_WD_TABLE, I'd like to group cells having the same value, but only within the context of the value of another cell. To explain what I'm trying to achieve, please see the images below.
The table on the left (Raw Data) shows the data without any groupings. The table in the middle (Desired) is what I'd like the groupings to be-- I'd like value "ABC" to merge only within the context of grouped "Record ID" values. The table on the right (Actual) is what I'm able to achieve using the IF_SALV_WD_SORT methods-- I can group field VALUE, but it groups all "ABC" values together rather than within the context of the "Record ID" value.
DATA lo_model TYPE REF TO cl_salv_wd_config_table.
DATA lo_field TYPE REF TO cl_salv_wd_field.
lo_model = wd_this->wd_cpifc_alv_table( )->get_model( ).
lo_field = lo_model->if_salv_wd_field_settings~get_field( 'RECORD_ID' ).
lo_field->if_salv_wd_sort~create_sort_rule( sort_position = 1 ).
lo_field->if_salv_wd_sort~set_grouping_allowed( ).
lo_field = lo_model->if_salv_wd_field_settings~get_field( 'VALUE' ).
lo_field->if_salv_wd_sort~create_sort_rule( sort_position = 2).
lo_field->if_salv_wd_sort~set_grouping_allowed( ).
Does anyone know if it's possible to achieve this sort of contextual field grouping in SALV_WD_TABLE?
Cheers,
Amy