2022 Aug 12 12:37 PM
Experts,
I am developing an Report using SALV factory, Here i need to make
1. Title (TOP of page) as bold in character. How to do it.
2. Where the user runs the report's (Selection screen date to display in top of page) Ie : 01.07.2022 to 31.07.2022.
METHOD output_data.
DATA: error_message TYPE REF TO cx_salv_msg,
alv_column TYPE REF TO cl_salv_columns_table,
lo_header TYPE REF TO cl_salv_form_layout_grid,
lo_h_label TYPE REF TO cl_salv_form_label,
lo_h_flow TYPE REF TO cl_salv_form_layout_flow.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = alv_table
CHANGING
t_table = lt_last.
CATCH cx_salv_msg INTO error_message .
ENDTRY.
CALL METHOD me->set_column
CHANGING
co_alv = alv_table.
CALL METHOD me->top_of_page
CHANGING
co_alv = alv_table.
CALL METHOD toolbar_data( ).
CREATE OBJECT lo_header.
lo_h_flow = lo_header->create_flow( row = 1 column = 1 ).
lo_h_flow->create_text( text = 'Title : Cheque Register Report.' ).
lo_h_flow = lo_header->create_flow( row = 2 column = 1 ).
lo_h_flow->create_text( text = 'Vendor.' ).
lo_h_flow->create_text( text = po_lifnr ).
alv_table->set_top_of_list( lo_header ).
alv_table->display( ).
ENDMETHOD.

Experts,
I am developing an Report using SALV factory, Here i need to make
1. Title (TOP of page) as bold in character. How to do it.
2. Where the user runs the report's (Selection screen date to display in top of page) Ie : 01.07.2022 to 31.07.2022.
METHOD output_data.
DATA: error_message TYPE REF TO cx_salv_msg,
alv_column TYPE REF TO cl_salv_columns_table,
lo_header TYPE REF TO cl_salv_form_layout_grid,
lo_h_label TYPE REF TO cl_salv_form_label,
lo_h_flow TYPE REF TO cl_salv_form_layout_flow.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = alv_table
CHANGING
t_table = lt_last.
CATCH cx_salv_msg INTO error_message .
ENDTRY.
CALL METHOD me->set_column
CHANGING
co_alv = alv_table.
CALL METHOD me->top_of_page
CHANGING
co_alv = alv_table.
CALL METHOD toolbar_data( ).
CREATE OBJECT lo_header.
lo_h_flow = lo_header->create_flow( row = 1 column = 1 ).
lo_h_flow->create_text( text = 'Title : Cheque Register Report.' ).
lo_h_flow = lo_header->create_flow( row = 2 column = 1 ).
lo_h_flow->create_text( text = 'Vendor.' ).
lo_h_flow->create_text( text = po_lifnr ).
alv_table->set_top_of_list( lo_header ).
alv_table->display( ).
ENDMETHOD.

2022 Aug 12 9:16 PM
Why dont you use a LABEL in place of the TEXT to get it BOLD?
(lo_flow->create_label)
Also, use a String Template to construct the dates from the selection screen parameters.
display it using: lo_label->set_text
2022 Aug 17 6:22 AM
Dear Sandeep,
Thanks for swift response.
First point okay for me,
Please guidance me with 2nd Point (Where the user runs the report's (Selection screen date to display in top of page) Ie : 01.07.2022 to 31.07.2022.) with some piece code.
Awaiting for your response.
Thanks ,
Senthil.G
2022 Aug 17 7:00 AM
Hi divsmart
assume your date variable as s_date-low and s_date-high
Add the following statement and put thatin your create_text as below
write s_date-low to date1 'dd/mm/yyyy'.
write s_date-high to date2 'dd/mm/yyyy'.
concatenate date1 date2 into str separated by '-'.
lo_h_flow->create_text( text = str ).
regards,
Venkat
2022 Aug 23 7:25 PM
2022 Aug 24 8:11 AM
If the answer is correct, could you please accept it?
Note that I can find many answers for code, even blog post, with below search:
"cl_salv_table" "create_label" site:sap.com
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |