Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BOLD text in OOPS

divsmart
Participant
0 Likes
2,140

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.

5 REPLIES 5
Read only

sandeephari1
Discoverer
0 Likes
1,927

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

Read only

0 Likes
1,927

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

Read only

0 Likes
1,927

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

Read only

0 Likes
1,927

Thanks Venkat,

Much Helpfull...

Read only

0 Likes
1,927
divsmart

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