cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Header Text in ALV report.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Nirav,

Regards,

Sravanthi

former_member585060
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

First of all thanks for the reply.

But i don't have any problems with the heaer of the Alv grid.

My problem is with the sales order text which i am displaying as the content of the column which is not coming full.

For EX : I have 2 sales order : 100 & 101.

Then in My grid i am displaying that SO as

Heading : Sales Order Text

Content 100 Shipping instruction

101 Shipping details - ( This is coming only 128 characters even if Sales order 101

has more than 128 characters in its Header text.)

Thanks

Former Member
0 Kudos

Hi,

Take the Header Text variable Type C.

Eg : v_Header(200) type C.

Here 200 is the No.Of Characters

Former Member
0 Kudos

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