Application Development 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: 

text-bold

Former Member
0 Kudos

Hello,

How to make a text element bold in alv display.

7 REPLIES 7

Former Member
0 Kudos

HI Johnn,

Please specify what approach are you using for ALV

a) OOPs

b) Function Module.

Anyway I think in the previous post, this solution was given. please check

Manish

Message was edited by: Manish Kumar

Former Member
0 Kudos

I am trying to do it in OOps.

Please tell me the method & class name clearly.

0 Kudos

If u want to make a cell/row values in bold, check the below step.

In the final internal table declare a field celltab TYPE lvc_t_styl,

In the layout give it as wa_layout-stylefname = 'CELLTAB'.

Read the final internal table with the field name and row/cell u want to make it as bold. Do the below coding.

READ TABLE i_final_data INTO wa_final_data INDEX 1.

ls_celltab-fieldname = 'LNG_TYPES'.

ls_celltab-style = '00000060'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

Here <b>ls_celltab-style = '00000060'.</b> will make that cell in bold.

Regards,

Prakash.

Former Member
0 Kudos

Hi

Check out the sample code:

*-- ALV Grid data declaration

----


  • CLASS v_lcl_event_receiver DEFINITION

----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_print_top_of_page FOR EVENT print_top_of_page OF

cl_gui_alv_grid,

handle_top_of_page FOR EVENT top_of_page OF

cl_gui_alv_grid,

handle_double_click FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column.

ENDCLASS. "o_lcl_event_receiver DEFINITION

data: o_html TYPE REF TO cl_dd_document.

*

DATA: lws_text TYPE sdydo_text_element.

IF cl_gui_alv_grid=>offline( ) IS INITIAL.

*-- Object for HTML top container

CREATE OBJECT o_html

EXPORTING style = 'ALV_GRID'

background_color = 35.

*-- Top of Page

CALL METHOD o_alvgrid->list_processing_events

EXPORTING

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = o_html.

*

*-- Total Record Text

CALL METHOD o_html->add_text

EXPORTING

text = 'Header 1'

sap_emphasis = 'STRONG'. " for bold

*

CALL METHOD o_html->add_gap

EXPORTING

width = 8.

lws_text = 'Header 2'.

CALL METHOD o_html->add_text

EXPORTING

text = lws_text

sap_emphasis = 'STRONG'. " for bold

CLEAR lws_text.

CALL METHOD o_html->new_line

EXPORTING

repeat = 1.

Reward points if this helps.

Manish

0 Kudos

Hai manish,

I cannot call this method ..........

what is the class name & method name for this.

CALL METHOD o_html->add_text

EXPORTING

text = lws_text

sap_emphasis = 'STRONG'. " for bold

Message was edited by: Johnn Abraham

0 Kudos

data: o_html TYPE REF TO cl_dd_document,

CREATE OBJECT o_html

EXPORTING style = 'ALV_GRID'

background_color = 35.

CALL METHOD o_alvgrid->list_processing_events

EXPORTING

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = o_header.

CALL METHOD o_html->new_line

EXPORTING

repeat = 0.

-- No of Installation

CALL METHOD o_header->add_text

EXPORTING

text = text-022 "No of Installations

sap_emphasis = text-023. " STRONG

sap_emphasis = Strong will make the text in bold.

Regards,

Prakash.

Former Member
0 Kudos

hi John,

this thread should help you