Skip to Content
avatar image
Former Member

Displaying Header Text in ALV report.

HI Gurus,

I have one sales order which has header Text.

I am displaying that Header Text in my ALV report.

But while displaying in the ALV grid, the text is not coming full.

I have taken the datatype of the column of the ALV grid is string, Still the Header text is not come full.

Please help me.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 10, 2009 at 04:29 PM

    Hi Nirav,

    Are you using a classical (REUSE_ALV_GRID_DISPLAY) or OO (CL_GUI_ALV_GRID) ALV report for the display?

    If you are using a REUSE_ALV_GRID_DISPLAY - are you using REUSE_ALV_COMMENTARY_WRITE to display the header ? If yes, then you need to remember that each line of the ALV header contains only 60 characters, hence you might want to split the Sales Order header into multiple lines of 60 characters each and build the table passed to IT_LIST_COMMENTARY.

    Cheers,

    Adi

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2009 at 04:59 PM

    Hi,

    If the header text is morethan 60 characters, you can't print with REUSE_ALV_COMMENTARY_WRITE. To overcome above limit we can use dynamic document, which can be implemented through the class CL_DD_DOCUMENT. As dynamic documents use HTML viewer control so instead of triggering the TOP_OF_PAGE event we should trigger event of HTML TOP_OF_PAGE.

    First create a subroutine for top of page in HTML format and send that name in I_CALLBACK_HTML_TOP_OF_PAGE parameter of ALV function module. The input parameter for this subroutine will be a variable of class CL_DD_DOCUMENT.

    *-----------------------------------------------------------------*
    *       FORM html_top_of_page                                     *
    *-----------------------------------------------------------------*
    FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
      data: l_text(255) type c.
     
    l_text = '*******************************Hellooooooooooooooooooo************************'.
     
      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.
     
    * Display ALV grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'     " Use this event
              i_callback_program          = g_repid
              i_structure_name            = 'STRUCTURE'
         TABLES
              t_outtab                    = gt_outtab.

    Regards

    Bala Krishna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2009 at 04:04 AM

    Hi Nirav,

    text-in-alv-header

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded