Powered By

Free XML Skins for Blogger

Powered by Blogger

Thursday, February 12, 2009

sap abap program for 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.

No comments:

Archives