Application Development and Automation 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: 
Read only

ALV GRID Header

Former Member
0 Likes
470

Hi,

Is the Fm reuse_alv_commentary_write only option to display the header in alv grid reports.

Actual in an grid based report I have to disply the header exactly wwith uname,date etc being displayed at various positions(diferent rows with required gaps).

could anyone let me know how to trace out this positions. Also, could anyone let me know how to paste a small piece of screen shot while posting the issues. So that I can show it clearly.

Thanks

Natasha SS

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
435

Hi Natasha, <li><font color='red'>could anyone let me know how to paste a small piece of screen shot while posting the issues. So that I can show it clearly.</font> 1. First upload your screen shot to any forum or blog and paste the link here. <li>Regarding header as you requested, we should not use REUSE_ALV_COMMENTORY_WRITE function module. You have to follow the code to get as u requested. Instead using TOP_OF_PAGE event, you have to use HTML_TOP_OF_PAGE event.


*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
FORM top_of_page USING document TYPE REF TO cl_dd_document.
  DATA:
        l_text TYPE sdydo_text_element.

  l_text = 'xyz'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_emphasis = cl_dd_document=>strong
      sap_style    = cl_dd_document=>key.

  CALL METHOD document->new_line.
  l_text = 'lmn'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_fontsize = cl_dd_document=>medium
      sap_color    = cl_dd_document=>list_positive
      sap_style    = cl_dd_document=>key.

  CALL METHOD document->underline.
  CALL METHOD document->add_gap
    EXPORTING
      width = '25'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_fontsize = cl_dd_document=>medium
      sap_color    = cl_dd_document=>list_positive
      sap_style    = cl_dd_document=>key.

ENDFORM.                    "top_of_page
<li>Then pass this subroutine through function module.

 DATA :l_program TYPE sy-repid.
  l_program = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = l_program
      i_callback_html_top_of_page = 'TOP_OF_PAGE'
      is_layout                   = w_layout
      it_events                   = i_events
      it_fieldcat                 = i_fieldcat
    TABLES
      t_outtab                    = i_pa0001.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
I hope that it helps you. Thanks Venkat.O

Hi,

Is the Fm reuse_alv_commentary_write only option to display the header in alv grid reports.

Actual in an grid based report I have to disply the header exactly wwith uname,date etc being displayed at various positions(diferent rows with required gaps).

could anyone let me know how to trace out this positions. Also, could anyone let me know how to paste a small piece of screen shot while posting the issues. So that I can show it clearly.

Thanks

Natasha SS

2 REPLIES 2
Read only

venkat_o
Active Contributor
0 Likes
436

Hi Natasha, <li><font color='red'>could anyone let me know how to paste a small piece of screen shot while posting the issues. So that I can show it clearly.</font> 1. First upload your screen shot to any forum or blog and paste the link here. <li>Regarding header as you requested, we should not use REUSE_ALV_COMMENTORY_WRITE function module. You have to follow the code to get as u requested. Instead using TOP_OF_PAGE event, you have to use HTML_TOP_OF_PAGE event.


*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
FORM top_of_page USING document TYPE REF TO cl_dd_document.
  DATA:
        l_text TYPE sdydo_text_element.

  l_text = 'xyz'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_emphasis = cl_dd_document=>strong
      sap_style    = cl_dd_document=>key.

  CALL METHOD document->new_line.
  l_text = 'lmn'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_fontsize = cl_dd_document=>medium
      sap_color    = cl_dd_document=>list_positive
      sap_style    = cl_dd_document=>key.

  CALL METHOD document->underline.
  CALL METHOD document->add_gap
    EXPORTING
      width = '25'.
  CALL METHOD document->add_text
    EXPORTING
      text         = l_text
      sap_fontsize = cl_dd_document=>medium
      sap_color    = cl_dd_document=>list_positive
      sap_style    = cl_dd_document=>key.

ENDFORM.                    "top_of_page
<li>Then pass this subroutine through function module.

 DATA :l_program TYPE sy-repid.
  l_program = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = l_program
      i_callback_html_top_of_page = 'TOP_OF_PAGE'
      is_layout                   = w_layout
      it_events                   = i_events
      it_fieldcat                 = i_fieldcat
    TABLES
      t_outtab                    = i_pa0001.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
I hope that it helps you. Thanks Venkat.O

Read only

Former Member
0 Likes
435

Hi,

You can use the Write statement in the TOP_OF_PAGE to write the contents in the Top of Page instead of using FM reuse_alv_commentary_write .