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: 

Header in ALV print (no OO)

former_member1038687
Active Participant
0 Kudos

Hi friends! I need some help. I made an ALV using function (not OO). IN screen everything is fine, inclusive header with logo, but when I send it to printer, all header don't print! Why my header don't get printed?

Thanks for any help!

1 ACCEPTED SOLUTION

former_member1038687
Active Participant
0 Kudos

Thanks again Clemens Li .

I tried like this: (excluding logo)

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_listhdr.

But in spool at SP01, header still missing...

6 REPLIES 6

Clemenss
Active Contributor
0 Kudos

Hi Fulvio,

printing an ALV grid will convert it to a list. Grid header is HTML, list header is ASCII. It depends on how you create the header, especially the logo will cause trouble.

Online, you should have the print prview (globe) icon. Try this to see what you may get.

Regards,

Clemens

former_member1038687
Active Participant
0 Kudos

Thanks for reply!

I made the header using i_callback_top_of_page = 'TOP_OF_PAGE' parameter in function REUSE_ALV_GRID_DISPLAY and in form TOP_OF_PAGE I have:

CHECK v_header <> 'X'.

w_listhdr-info = ''.

APPEND w_listhdr TO it_listhdr.

w_listhdr-typ = 'H'.

w_listhdr-info = 'Report Fiotec of users '.

APPEND w_listhdr TO it_listhdr.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

i_logo = 'FIOTEC_LOGO1'

it_list_commentary = it_listhdr.

v_header = 'X'.

How can I print the header in ASCII? Logo is not really necessary, its just a plus...

0 Kudos

Hi Fulvio,

just try without LOGO, 'REUSE_ALV_COMMENTARY_WRITE' will convert to list-readable format.

Regards,

Clemens

former_member1038687
Active Participant
0 Kudos

Thanks again Clemens Li .

I tried like this: (excluding logo)

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_listhdr.

But in spool at SP01, header still missing...

0 Kudos

v_header = 'X'.

why is this needed? remove it and try. i guess you are using it to show the top of page only once..

0 Kudos

Hi Fulvio,

I just tried and it works with this form

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
...
    I_CALLBACK_TOP_OF_PAGE                = 'TOP'
...

FORM top.
  data:
    lt_LISTHEADER      type SLIS_T_LISTHEADER.

  FIELD-SYMBOLS:
    <LISTHEADER>       type line of SLIS_T_LISTHEADER.

  APPEND INITIAL LINE TO lt_LISTHEADER.
  APPEND INITIAL LINE TO lt_LISTHEADER ASSIGNING <LISTHEADER>.
  <LISTHEADER>-typ = 'H'.
  <LISTHEADER>-info = 'Report Fiotec of users '.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
*      i_logo             = 'FIOTEC_LOGO1'
      it_list_commentary = lt_LISTHEADER.
ENDFORM.                    "top

In the grid, we have big-sized 'Report Fiotec of users ', space line before is ignored.

In print preview as in the spool file, 'Report Fiotec of users ' is output on top in default character size.

You may set a breakpoint in the Form to see if it is called and processed correctly. Possibly it is because you try to create the output only on first page - that mean only once in your case. Better check IF SY-PAGNO = 1 or use the event TOP_OF_LIST.

Regards,

Clemens