2022 Oct 17 11:22 AM
Hello Guru's,
How can we hide particular column according to a particular condition in ALV.
2022 Oct 17 11:28 AM
This is for the usage of CL_SALV_TABLE:
TRY.
cl_salv_table=>factory(
EXPORTING
r_container = i_container
IMPORTING
r_salv_table = DATA(r_salv_table)
CHANGING
t_table = gt_output
).
CATCH cx_salv_msg.
ENDTRY.
IF p_showde NE abap_true.
* Deleted documents should not be shown => hide column with deletion flag
r_salv_table->get_columns( )->get_column( 'LOEKZ' )->set_technical( ).
ENDIF.
If the column should be still available in the cataglog, but not visible:
r_salv_table->get_columns( )->get_column( 'LOEKZ' )->set_visible( abap_false ).
2022 Oct 17 11:28 AM
This is for the usage of CL_SALV_TABLE:
TRY.
cl_salv_table=>factory(
EXPORTING
r_container = i_container
IMPORTING
r_salv_table = DATA(r_salv_table)
CHANGING
t_table = gt_output
).
CATCH cx_salv_msg.
ENDTRY.
IF p_showde NE abap_true.
* Deleted documents should not be shown => hide column with deletion flag
r_salv_table->get_columns( )->get_column( 'LOEKZ' )->set_technical( ).
ENDIF.
If the column should be still available in the cataglog, but not visible:
r_salv_table->get_columns( )->get_column( 'LOEKZ' )->set_visible( abap_false ).
2022 Oct 17 12:08 PM
The answer will depend on the ALV technology that you are using... What is it?
2022 Oct 17 12:08 PM