on 2025 Feb 14 3:44 PM
Hi all:
(Running ABAP 7.50)
I’m trying to use the set_suppress_empty_data( abap_true ), but keep getting a dump and an error message (Class DISPLAY_SETTINGS, method SET_SUPPRESS_EMPTY_DATA not supported for CL_SALV_TABLE Control Technology).
My test code is as follows:
REPORT ztest.
DATA alv TYPE REF TO cl_salv_table.
DATA display_setting TYPE REF TO cl_salv_display_settings.
" ====================================
" Get some sample data
" ====================================
select * FROM trdir
where name = 'DEMO_EXPRESSIONS'
into table @DATA(itab).
TRY.
" ====================================
" Just a plain CL_SALV_TABLE
" ====================================
cl_salv_table=>factory( IMPORTING r_salv_table = alv
CHANGING t_table = itab ).
display_setting = alv->get_display_settings( ).
" ====================================
" This generates a DUMP (ignores TRY)
" ====================================
display_setting->set_suppress_empty_data( abap_true ).
alv->display( ).
CATCH cx_salv_msg INTO data(error_cx).
MESSAGE error_cx TYPE 'E' DISPLAY LIKE 'I'.
ENDTRY.
The error ignores the TRY…CATCH block.
Any ideas?
TIA,
Luis
Request clarification before answering.
You only catch CX_SALV_MSG and its subclasses, but not CX_SALV_METHOD_NOT_SUPPORTED which is not a subclass of this one but of CX_SALV_NO_CHECK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.