How to make ALV header like this?

Header long text 1 Header long text 2 Header long text 3 
Col_1 Col_2 Col_3 Col_4 Col_5 Col_6 Col_7 Col_8 Col_9 
----------------------- Cell conents ------------------------------- 
----------------------- Cell conents ------------------------------- 
----------------------- Cell conents ------------------------------- 
----------------------- Cell conents ------------------------------- 
----------------------- Cell conents ------------------------------- 

You could try: 
data: gt_list_top_of_page type slis_t_listheader. " Top of page text. 

Initialization. 
perform comment_build using gt_list_top_of_page[]. 

form top_of_page. 
* Note to self: the gif must be loaded into transaction OAOR with 
* classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions. 
* I Loaded NOVALOGO2 into system. 
 call function 'REUSE_ALV_COMMENTARY_WRITE' 
     exporting 
* I_LOGO = 'NOVALOGO2' 
* i_logo = 'ENJOYSAP_LOGO' 
         it_list_commentary = gt_list_top_of_page. 

endform. " TOP_OF_PAGE 

form comment_build using e04_lt_top_of_page type slis_t_listheader. 
data: ls_line type slis_listheader. 
      clear ls_line. 
      ls_line-typ = 'A'. 
      ls_line-info = 'Special'(001). 
      fgrant = xgrant. 
      concatenate ls_line-info fgrant 
      'Stock Option Report to the board'(002) 
             into ls_line-info separated by space. 
                    condense ls_line-info. 
      append ls_line to e04_lt_top_of_page. 

endform. " COMMENT_BUILD

How to implement a footer in alv grid programming? What is the procedure and the code regarding to create a footer?

Use following syntex for footer print in alv:

* For End of Page

form END_OF_PAGE.

  data: listwidth type i,

        ld_pagepos(10) type c,

        ld_page(10)    type c.

  write: sy-uline(50).
  skip.
  write:/40 'Page:', sy-pagno .

endform.

*  For End of Report

form END_OF_LIST.

  data: listwidth type i,

        ld_pagepos(10) type c,
        ld_page(10)    type c.
  skip.
  write:/40 'Page:', sy-pagno .

endform.

Tips by : Gopal Arora

ABAP

Fast Links:
ALV Header

SAP Books
SAP Certification, Interview Questions, Functional, Basis Administration and ABAP Programming Reference Books

ABAP Tips
ABAP and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.