Code: Alles auswählen.
DATA: ls_color TYPE lvc_s_colo,
lr_column_to_edit TYPE REF TO cl_salv_column_table,
ls_key TYPE salv_s_layout_key.
mr_sort->add_sort(
EXPORTING
columnname = 'MATNR' " ALV-Control: Feldname internes Tabellenfeld
sequence = if_salv_c_sort=>sort_up " Sortierreihenfolge
position = 1
* subtotal = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
group = if_salv_c_sort=>group_with_underline " Gruppenwechsel
obligatory = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
).
mr_sort->add_sort(
EXPORTING
columnname = 'WERKS' " ALV-Control: Feldname internes Tabellenfeld
sequence = if_salv_c_sort=>sort_up " Sortierreihenfolge
position = 2
subtotal = if_salv_c_bool_sap=>false " boolsche Variable (X=true, space=false)
* group = if_salv_c_sort=>group_with_underline " Gruppenwechsel
obligatory = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
).
mr_sort->add_sort(
EXPORTING
columnname = 'MAKTX' " ALV-Control: Feldname internes Tabellenfeld
sequence = if_salv_c_sort=>sort_up " Sortierreihenfolge
position = 3
subtotal = if_salv_c_bool_sap=>false " boolsche Variable (X=true, space=false)
* group = if_salv_c_sort=>group_with_underline " Gruppenwechsel
obligatory = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
).
mr_sort->add_sort(
EXPORTING
columnname = 'STOCK' " ALV-Control: Feldname internes Tabellenfeld
sequence = if_salv_c_sort=>sort_up " Sortierreihenfolge
position = 4
* subtotal = if_salv_c_bool_sap=>false " boolsche Variable (X=true, space=false)
* group = if_salv_c_sort=>group_with_underline " Gruppenwechsel
obligatory = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
).
mr_sort->add_sort(
EXPORTING
columnname = 'MEINS' " ALV-Control: Feldname internes Tabellenfeld
sequence = if_salv_c_sort=>sort_up " Sortierreihenfolge
position = 5
* subtotal = if_salv_c_bool_sap=>false " boolsche Variable (X=true, space=false)
* group = if_salv_c_sort=>group_with_underline " Gruppenwechsel
obligatory = if_salv_c_bool_sap=>true " boolsche Variable (X=true, space=false)
).
mr_sort->set_group_active( if_salv_c_bool_sap=>true ).