2023 Sep 07 1:33 PM
Hi experts,
I'm trying to change the color of the header title using cl_salv_display_settings.
I haven't found a way to change the color.
Do you think it is possible?
DATA: gr_table TYPE REF TO cl_salv_table,
lr_display TYPE REF TO cl_salv_display_settings.
lv_title TYPE lvc_title.
lv_title = 'TEST'.
lr_display = gr_table->get_display_settings( ).
lr_display->set_list_header( lv_title ).
Thank you so much!
2023 Sep 07 2:36 PM
2023 Sep 08 5:52 PM
Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!
2023 Sep 08 5:55 PM
Some people could do it: The case of the missing cl_salv_form_layout_grid | SAP Blogs
2023 Sep 19 11:35 AM
Thanks for replies!
Finally, I solved the requirement with 2 containers in dynpro and cl_dd_document class
I post my source code, maybe it's useful for someone.
DATA: gr_container TYPE REF TO cl_gui_custom_container,
dd TYPE REF TO cl_dd_document,
o_split TYPE REF TO cl_gui_splitter_container,
o_alv TYPE REF TO cl_gui_container.
gr_table TYPE REF TO cl_salv_table.
IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.
CREATE OBJECT dd. "Global
CREATE OBJECT gr_container
EXPORTING
ENDIF.
" Split Object
CREATE OBJECT o_split
EXPORTING
parent = gr_container "Text/Title
rows = 1
columns = 1.
CALL METHOD o_split->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = o_alv. "Our ALV
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
r_container = o_alv
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = lt_data. "Our data
CATCH cx_salv_msg.
ENDTRY.
"ADD TITLE
CALL METHOD dd->add_text
EXPORTING
text = 'Text with red font colour'.
sap_emphasis = 'STRONG'
* sap_style = cl_dd_area=>list_negative_inv "bold
sap_color = cl_dd_area=>list_negative_inv "red color
sap_fontsize = cl_dd_document=>large
sap_fontstyle = cl_dd_area=>list_negative_inv
style_class = cl_dd_document=>list_negative_inv.
CALL METHOD dd->display_document
EXPORTING
container = 'HEADER'.
CALL METHOD gr_table->display.
2023 Sep 19 11:43 AM - edited 2024 Oct 24 9:02 AM
Thank you very much for sharing! And not writing just: "Solved" 🙂
2024 Oct 23 12:05 PM
Hello guys,
I hope is everything going well.
Thank you very much for this insight and for sharing the code @raul_sap_cl.
I was trying to implement the code, but I have a question. I need to implement two different containers in the screen painter to be able to achieve this?
I would kindly like to ask for some additional info or prints about the containers if possible.
Thank you,
Have a great day,
Best Regards