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 hide background color of header column in alv list display

Former Member
0 Kudos
436

Hi Experts,

I have issue while printing alv list display.The blue background color of header row (i.e Header columns)is looking like dark when i take print out.I need to eliminate background color.Is there any way to hide or remove background color.please let me know if have solution

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos
91

Hi,

There is no standard functionality to do this.

Try some work around like in layout parameter of the ALV pass no_header = 'X' and then create your own header using function RKD_WORD_WRAP. Check this link http://sample-code-abap.blogspot.in/2008/01/printing-multiple-line-header-and.html 

in which the subroutine top_of_page is used. DO the required changes in statement "FORMAT COLOR COL_HEADING"

Kesav

7 REPLIES 7

kesavadas_thekkillath
Active Contributor
0 Kudos
92

Hi,

There is no standard functionality to do this.

Try some work around like in layout parameter of the ALV pass no_header = 'X' and then create your own header using function RKD_WORD_WRAP. Check this link http://sample-code-abap.blogspot.in/2008/01/printing-multiple-line-header-and.html 

in which the subroutine top_of_page is used. DO the required changes in statement "FORMAT COLOR COL_HEADING"

Kesav

0 Kudos
91

Hi Kesav,

Do we need to use RKD_WORD_WRAP to do this?

This can be done just by using TOP OF PAGE.

Thanks,

Shambu

0 Kudos
91

Hi Shambu,

Didn't think about it. There are different work around as you noticed. First thing which came to my mind was this function , so suggested it. If it's directly working then that would be the best.

Kesav

0 Kudos
91

Hi Shambu,

that's 5ne.but in alv  ouput fields getting varied based on the input given from drop-down list.If i hard code positions of fields  it looks bad.almost iam generating 8 different alv reports one at a time  based on the value given in drop-down.can you suggest me any other solution

0 Kudos
91

Hi,

You can try this way.

In the AFTER_LINE_OUTPUT, add the code below.

   TYPE-POOLS slis .
*----------------------------------------------------------------------*
* Data Declarations
*----------------------------------------------------------------------*
CONSTANTS : c_len TYPE i VALUE 20 .

TYPES : BEGIN OF ty_t100 ,
sprsl TYPE t100-sprsl ,
arbgb TYPE t100-arbgb ,
msgnr TYPE t100-msgnr ,
text TYPE t100-text ,
fline TYPE t100-text ,
END OF ty_t100 .

TYPES : BEGIN OF ty_wrd ,
text TYPE char20 ,
END OF ty_wrd .

DATA : it_t100 TYPE TABLE OF ty_t100    ,
it_sentence TYPE TABLE OF ty_wrd ,
wa_t100 TYPE ty_t100             ,
wa_word TYPE ty_wrd              ,
v_repid TYPE syst-repid          ,
v_tabix TYPE syst-tabix          .

DATA : it_fld TYPE slis_t_fieldcat_alv ,
it_evt TYPE slis_t_event        ,
wa_fld TYPE slis_fieldcat_alv   ,
wa_evt TYPE slis_alv_event      ,
wa_lay TYPE slis_layout_alv     .
*----------------------------------------------------------------------*
* Initialization
*----------------------------------------------------------------------*
INITIALIZATION .
  v_repid = sy-repid .
*---------------------------------------------------------------------*
* Start of Selection
*----------------------------------------------------------------------*
START-OF-SELECTION .
* Get some test data to display in ALV List
  SELECT *
  INTO TABLE it_t100
  FROM t100
  WHERE sprsl = 'EN'
  AND arbgb = '00' .
* Prepare fieldcatelog
  CLEAR wa_fld .
  wa_fld-fieldname = 'SPRSL' .
  wa_fld-ref_tabname = 'T100' .
  wa_fld-ref_fieldname = 'SPRSL' .
  APPEND wa_fld TO it_fld .
  CLEAR wa_fld .
  wa_fld-fieldname = 'ARBGB' .
  wa_fld-ref_tabname = 'T100' .
  wa_fld-ref_fieldname = 'ARBGB' .
  APPEND wa_fld TO it_fld .
  CLEAR wa_fld .
  wa_fld-fieldname = 'MSGNR' .
  wa_fld-ref_tabname = 'T100' .
  wa_fld-ref_fieldname = 'MSGNR' .
  APPEND wa_fld TO it_fld .
  CLEAR wa_fld .
  wa_fld-fieldname = 'TEXT' .
  wa_fld-ref_tabname = 'T100' .
  wa_fld-ref_fieldname = 'TEXT' .
  APPEND wa_fld TO it_fld .
* Get event.. we will handle BEFORE and AFTER line output
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    IMPORTING
      et_events = it_evt.
  READ TABLE it_evt INTO wa_evt
  WITH KEY name = slis_ev_after_line_output .
  wa_evt-form = slis_ev_after_line_output .
  MODIFY it_evt FROM wa_evt INDEX sy-tabix .
*wa_lay-no_colhead = 'X' .

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program = v_repid
      it_fieldcat        = it_fld
      is_layout          = wa_lay
      it_events          = it_evt
    TABLES
      t_outtab           = it_t100.

*---------------------------------------------------------------------*
* FORM AFTER_LINE_OUTPUT *
*---------------------------------------------------------------------*
FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo .

  DATA :test TYPE string.
  READ LINE 2 OF CURRENT PAGE LINE VALUE INTO test.
  MODIFY LINE 2 OF CURRENT PAGE LINE FORMAT COLOR OFF.
ENDFORM .                    "after_line_output

Here 2 is the line where my Header starts.

Run this program and check.

Thanks,

Shambu

0 Kudos
91

Hi Shambu,

It is really helpful solution to our requirement.

Thank You,

Swetha.C

Former Member
0 Kudos
91

thx a lot it is working 5ne..