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 display issue?

Former Member
0 Likes
582

Hi Experts,

   I have a requirement to set ALV header which is more than 240 charecters long.As per my knowledge a header with more than 132 charecters  cannot be set. I have seen in some post we can use html_top_of_page if the number of charecter is more than 240(Correct me if I am wrong).Suppose if I am using  html_top_of_page will the entire(more than 240 charecters) line be displayed as a single row or whether it will be diplayed as more than one row.

Please help me on this.

Regards,

Alexander.

2 REPLIES 2
Read only

Former Member
0 Likes
548

Yes,

you can upto 255 characters.

Here is an example with screenshot

http://saptechnical.com/Tutorials/ALV/TopofPage/Solution.htm

Regards,

Read only

Former Member
0 Likes
548

Dear Alex,

Top of page event we can display only 254 characters through cl_dd_document.


Please check these Code these will resolve your issue. Please point me one these code helps.

DATA : gt_ekko TYPE STANDARD TABLE OF ekko,
        l_text(255) TYPE c.

START-OF-SELECTION.
   SELECT * FROM ekko UP TO 10 ROWS INTO TABLE gt_ekko.
   DO 254 TIMES.

     l_text+sy-index(1) = '*'.
   ENDDO.
   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
       i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
       i_callback_program          = sy-cprog
       i_structure_name            = 'EKKO'
     TABLES
       t_outtab                    = gt_ekko.
*&---------------------------------------------------------------------*
*&      Form  html_top_of_page
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->TOP        text
*----------------------------------------------------------------------*
FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
   CALL METHOD top->add_text
     EXPORTING
       text      = 'Hello world '
       sap_style = 'heading'.
   CALL METHOD top->add_gap
     EXPORTING
       width = 200.
   CALL METHOD top->add_picture
     EXPORTING
       picture_id = 'ENJOYSAP_LOGO'.
   CALL METHOD top->new_line( ).
   CALL METHOD top->add_text
     EXPORTING
       text = l_text.
ENDFORM.                    "html_top_of_page

Output will be


Thanks and Regards,

buz_sap