cancel
Showing results for 
Search instead for 
Did you mean: 

set_lowercase( ) from cl_salv_column_table not working

Will2
Explorer
0 Kudos
105

Hi,

I've tried all format combinations of Character and String, and the "case-sensitive" property on domains, but the text never changes - it's always displayed in the ALV as per the database. 

Anyone else having this issue?

 

TABLES: tvfk.
DATA: t_tvfk TYPE TABLE OF tvfk.
DATA: o_table TYPE REF TO cl_salv_table.
DATA: lo_columns TYPE REF TO cl_salv_columns_table,
      lo_column  TYPE REF TO cl_salv_column_table.
DATA: lt_columns TYPE salv_t_column_ref,
      ls_columns TYPE salv_s_column_ref.

START-OF-SELECTION.
  SELECT * FROM tvfk INTO CORRESPONDING FIELDS OF TABLE t_tvfk UP TO 50 ROWS.
  cl_salv_table=>factory( IMPORTING
                                r_salv_table = o_table
                          CHANGING
                                t_table      = t_tvfk ).
  lo_columns = o_table->get_columns( ).
  lt_columns = lo_columns->get( ).
  LOOP AT lt_columns INTO ls_columns.
    TRY.
        lo_column ?= lo_columns->get_column( columnname = ls_columns-columnname ).
      CATCH cx_salv_not_found.
        RETURN.
    ENDTRY.
    CASE ls_columns-columnname.
      WHEN 'VBTYP'. "has lower case property checked
        lo_column->set_lowercase( abap_true ).

      WHEN 'ERNAM'. "does not have lower case property checked
        lo_column->set_lowercase( abap_true ).

      WHEN OTHERS.
        lo_column->set_visible( abap_false ).
    ENDCASE.
  ENDLOOP.
* display
  o_table->display( ).

 

View Entire Topic
Tomas_Buryanek
Active Contributor
0 Kudos

Hi, I tried it and I agree it is confusing.
The purpose of this flag is obviously now what we expect?

Here Łukasz explained "set_lowercase" little bit in his blog + example:
https://abapblog.com/component/content/article?id=172:alv-grid-in-the-nutshell-field-catalog-lowerca...

So to set fields to lowercase/uppercase you need to update data in internal table yourself. Before you display them in ALV.