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: 

How to underline a column value in an ALV.

Former Member
0 Kudos

I have defined two variables to create an ALV:

DATA: fieldcat TYPE slis_fieldcat_alv OCCURS 0 WITH HEADER LINE,

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

I append each column I want to appear in the ALV.

Which option should I change in order to get a certain column underlined?

Thanks in advance.

1 ACCEPTED SOLUTION

lijisusan_mathews
Active Contributor
0 Kudos

if you give hotspot = 'X', the field will be underlined... It is actually used to make the list interactive and will trigger a user command, but if you don write the user command code for it, it will still show the underline.

4 REPLIES 4

lijisusan_mathews
Active Contributor
0 Kudos

if you give hotspot = 'X', the field will be underlined... It is actually used to make the list interactive and will trigger a user command, but if you don write the user command code for it, it will still show the underline.

ChandraMahajan
Active Contributor
0 Kudos

Hi,

use below code to undeline the column value(font).

  • Setting the styles for the ALV grid control

  • using field-symbols

LOOP AT it_fcat ASSIGNING <wa_fcat>. *For Each and every line of the fieldcat

CASE sy-tabix.*Color Styles

*Background/Font/Group/positive/negative

WHEN '1'.

<wa_fcat>-style = alv_style_color_inv_positive.

WHEN '2'.

<wa_fcat>-style = alv_style_color_int_negative.

WHEN '3'.

<wa_fcat>-style = alv_style_align_left_bottom.*Style for Font Underlined/Bold and Italic are possible

WHEN '9'.

<wa_fcat>-style = alv_style_font_underlined.ENDLOOP.

Thanks,

Chandra

ben_currie
Explorer
0 Kudos

Much like who you maintain your field catalog, you can maintain a table of type slis_sortinfo_alv for the fields you wish to underline.


DATA: it_sort TYPE STANDARD TABLE OF slis_sortinfo_alv.
      gs_sort TYPE  slis_sortinfo_alv.

gs_sort-fieldname = field_to_be_underlined1.
gs_sort-group = 'UL'.
APPEND gs_sort TO it_sort.

You can then pass it_sort to the ALV output FM like you do with your fieldcat.

This will underline the fields without having the hyperlink like making a hotspot will do.

ben_currie
Explorer
0 Kudos

Sorry double post

Edited by: squall457 on Nov 7, 2011 1:50 PM