11-02-2007 6:52 AM
can anyone provide me code for adding time at TOP-OF-PAGE with header name and date.the code which i have written is as follows
*********************************
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'DELIVERY INFORMATION'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
*Time
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
endform.
11-02-2007 6:58 AM
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
*Time
wa_header-typ = 'S'.
wa_header-key = 'Time: '.
CONCATENATE sy-uzeit+0(2) ':'
sy-uzeit2(2) ':' sy-uzeit4(2) INTO wa_header-info.
append wa_header to t_header.
clear: wa_header.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
endform.
regards
shiba dutta
11-02-2007 6:58 AM
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
*Time
wa_header-typ = 'S'.
wa_header-key = 'Time: '.
CONCATENATE sy-uzeit+0(2) ':'
sy-uzeit2(2) ':' sy-uzeit4(2) INTO wa_header-info.
append wa_header to t_header.
clear: wa_header.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
endform.
regards
shiba dutta
11-02-2007 6:59 AM
11-02-2007 7:01 AM
Hi,
check the below code
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
----
Form TOP-OF-PAGE *
----
ALV Report Header *
----
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
Reward if hlpful.
Regards,
Nagaraj
11-02-2007 7:08 AM
Hi,
refer this code.
&----
*& Form sub_top_of_page *
&----
This form is to build the Page Header *
----
FORM sub_top_of_page .
*--Local Variable
DATA : lv_title(120) TYPE c, " Title
lv_month(30) TYPE c,
lv_mont(30) TYPE c,
lv_bud(16) TYPE c.
*--Local Work Area
DATA : lwa_line TYPE slis_listheader. " Hold list header
CONCATENATE p_month 'to' s_hmonth INTO lv_month SEPARATED BY space.
IF NOT s_hmonth IS INITIAL.
lv_mont = lv_month.
ELSE.
lv_mont = p_month.
ENDIF.
*--Title Display
lwa_line-typ = 'H'. " header
lv_title = sy-title.
lwa_line-info = lv_title.
APPEND lwa_line TO it_header.
CLEAR lwa_line.
*--Month Display
lwa_line-typ = 'S'. " Item
WRITE: lv_mont TO lv_month.
lwa_line-key = text-024.
lwa_line-info = lv_month.
APPEND lwa_line TO it_header.
*--Budget Display
lwa_line-typ = 'S'. " Item
WRITE: p_bud TO lv_bud.
lwa_line-key = text-025.
lwa_line-info = lv_bud.
APPEND lwa_line TO it_header.
CLEAR: lwa_line,
lv_mont.
*--This funcation module will display the top of the page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_header.
*--Free
FREE : it_header.
ENDFORM. "sub_top_of_page
Regards,
Prashant