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 in color in ALV top-of-page

Former Member
0 Kudos

Hi all,

I am using REUSE_ALV_GRID_DISPLAY and using REUSE_ALV_COMMENTARY_WRITE to display top-of-page.

I need to show text in top-of-page in BOLD and RED color.

I am able to diaply in BOLD by passing slis_listheader-typ = 'H'

But I am not able to understand how I can achieve RED color.

I have checked forums but could not get solution.

Some of them are suggesting HTML top-of-page but they have not given details of how to use it and whether it can be used with REUSE_ALV_GRID_DISPLAY

It would be great if you can help me in achieving this.

Thanks in advance.

Regards

Vasu

1 ACCEPTED SOLUTION

former_member184578
Active Contributor
0 Kudos

Hi,

It is possible with custom container. so u use

CL_GUI_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY.

check DD_STYLE_TABLE report.

Create two custom containers., in one custom container display heading with colors and styles. and in other custom container display ALV..

hope this helps u.,

Thanks & Regards

Kiran

7 REPLIES 7

saumya_govil
Active Contributor
0 Kudos

Hi Vasu,

Try using parameter I_CALLBACK_HTML_TOP_OF_PAGE of the FM REUSE_ALV_GRID_DISPLAY to display header in different style.

You can search for this parameter on SDN for further details on its usage. Or search in your system in the where used list.

Regards,

Saumya

former_member184578
Active Contributor
0 Kudos

Hi,

It is possible with custom container. so u use

CL_GUI_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY.

check DD_STYLE_TABLE report.

Create two custom containers., in one custom container display heading with colors and styles. and in other custom container display ALV..

hope this helps u.,

Thanks & Regards

Kiran

Former Member
0 Kudos

Hi Vasu,

You can use the Write statement in Top of Page and can use the color option.

Try it.

Thanks

Arbind

Former Member
0 Kudos

maybe u can use this sample code or html top of page


FORM html_top_of_page USING document TYPE REF TO cl_dd_document.

"tcode
  CALL METHOD document->new_line.
  CLEAR dl_text.
  CONCATENATE 'T-code : ' sy-tcode INTO dl_text SEPARATED BY space.
  CALL METHOD document->add_text
    EXPORTING
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_style    = cl_dd_area=>heading "bold
      sap_color    = cl_dd_area=>list_negative_inv. "red color
  CLEAR : dl_text.

ENDFORM. 

Former Member
0 Kudos

Solved it myself

0 Kudos

Hi Vasu,

Can you please share me the solution. i have similar requirement.

Thanks

0 Kudos

How u do it please ?