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: 

Displaying Client standard header in ALV output

Former Member
0 Kudos

Hi everybody,

I am displaying the ALV report.

On the top-of-page Client standard header has to display.

Can any one suggest me how to achive this.

Thanks in advance.

Karunakar

5 REPLIES 5

Former Member
0 Kudos

Hi Karunakar,

I don't understand quite well your question. But if you would like to print a "standard" heading for your reports, you can use routine BATCH-HEADING(RSBTCHH0) at your top_of_page event (or routine, if you use ALV).

For example:

form top_of_page_routine.
  bhdgd-line1 = sy-title.
  bhdgd-line2 = 'Second line of text'.
  bhdgd-lines = sy-linsz.
  bhdgd-uname = sy-uname.
  bhdgd-repid = sy-cprog.

  PERFORM batch-heading(rsbtchh0).
endform.

and then...


...
  le_events-name = 'TOP_OF_PAGE'.
  le_events-form = 'TOP_OF_PAGE_ROUTINE'.
  APPEND le_events TO lt_events.
...
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
...
      it_events                      = lt_events
..

Hope it helps. BR,

Alvaro

0 Kudos

Hi Alvaro ,

I am using alv list (not grid) to show the output. But I have to show 4 lines over the top of report in following way...

Name of company

date

customer group

customer name

Here will be my list...

How to achieve this ?

Regards,

Dilip

0 Kudos

Hi,

Take a look at FM REUSE_ALV_COMMENTARY_WRITE and its documentation.

Regards

Message was edited by: Shehryar Khan

0 Kudos

Hi Dilip,

Here is a simple template:


FORM top_of_page USING cl_dd TYPE REF TO cl_dd_document.
*
  DATA: l_string TYPE sdydo_text_element.

  l_string = sy-title.
  CALL METHOD cl_dd->add_text
    EXPORTING text      = l_string
              sap_style = 'HEADING'.

  CALL METHOD cl_dd->new_line.

* ...you could use several calls to "cl_dd->new_line" 
* and "cl_dd->add_text" to get your heading lines, no
* matter how many they are
*
ENDFORM.                    " top_of_page

Then of course you should call the ALV:


    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
...
        i_callback_html_top_of_page       = 'TOP_OF_PAGE'
...

You can also insert images (with "call method l_logo->add_picture", if you define "data: l_logo type ref to cl_dd_area") or even split the heading vertically (by using "call method cl_dd->vertical_split".

I hope it helps. BR,

Alvaro

Former Member
0 Kudos

Could you clarify?

What type of ALV call are you making? The OO technique or the FM technique?

Do you want the title online, batch or both?

Are you referring to the standard title that SAP displays at the top of the GUI? For example, when you invoke SE80 it says 'Object Navigator' (4.6C) at the top? If this is what you want to change then take a look at the SET TITLEBAR command that you should issue in a PBO module to change the title online.