07-18-2008 8:23 AM
Hi Guy's,
Please help me, report in ALV format, i want to display on heading system time also. how to work this senario.
Thanks,
sai.
07-18-2008 8:30 AM
hi,
define the top_of_page and then pass the listheader to the function module.
FORM top_of_page1.
DATA:lw_listheader1 TYPE slis_listheader,
t_line LIKE lw_listheader1-info.
lw_listheader1-typ = 'S'. "selection data
lw_listheader1-key = text-013. "Time calculation*
*CONCATENATE sy-uzeit(2) ':'
sy-uzeit+2(2) ':'
sy-uzeit+4(2) INTO lw_listheader1-info.
APPEND lw_listheader1 TO i_listheader.
CLEAR lw_listheader1.
for printing the list headings.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader.
i_logo = 'ZNA_SARA'.
REFRESH i_listheader.
ENDFORM.
07-18-2008 8:27 AM
07-18-2008 8:30 AM
hi,
define the top_of_page and then pass the listheader to the function module.
FORM top_of_page1.
DATA:lw_listheader1 TYPE slis_listheader,
t_line LIKE lw_listheader1-info.
lw_listheader1-typ = 'S'. "selection data
lw_listheader1-key = text-013. "Time calculation*
*CONCATENATE sy-uzeit(2) ':'
sy-uzeit+2(2) ':'
sy-uzeit+4(2) INTO lw_listheader1-info.
APPEND lw_listheader1 TO i_listheader.
CLEAR lw_listheader1.
for printing the list headings.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader.
i_logo = 'ZNA_SARA'.
REFRESH i_listheader.
ENDFORM.
07-18-2008 8:59 AM
try this code to display time
REPORT ztest_bik .
data : wa type mara,
itab type table of mara.
select * from mara into corresponding fields of table itab up to 18 rows
.
GET TIME.
WRITE: /01 'Application server time:', sy-uzeit.
uline.
CALL FUNCTION 'zpraveen'
STARTING NEW TASK 'pr'
PERFORMING start_refresh ON END OF TASK.
AT USER-COMMAND.
IF sy-ucomm = 'REFR'.
sy-lsind = sy-lsind - 1.
GET TIME.
WRITE: /01 'Application server time:', sy-uzeit.
uline.
loop at itab into wa.
write 😕 wa-matnr,
wa-ersda,
wa-ernam.
endloop.
CALL FUNCTION 'zpraveen'
STARTING NEW TASK 'IF'
PERFORMING start_refresh ON END OF TASK.
ENDIF.
FORM start_refresh USING taskname.
SET USER-COMMAND 'REFR'.
endform.
just copy past and run
now mainupulate this code to use in ur ALV.
if u display system time it will be static but through this code u can diplay dynamic time.
hope this helps
Regards
Bikas
07-18-2008 9:38 AM
Hi Sai,
If you want to display the time at the top then there are two methods :
If u have container for the headings then u can add an input box to that container in attribute set that input box as output only and then in program u define:
data: input(6) type c.
input = sy-uzeit.
here sy-uzeit will display the current application server time.here i m providing some other system variables use according to ur need..
and if u r not using conatiner then u acn go for commentry-write function.
SY-TIMLO
Useru2019s local time, for example 154353, 225312, u2026
SY-TZONE
Time difference in seconds between local time and Greenwich Mean Time (UTC), for example, 360, 10800.
SY-UZEIT
Current application server time. for example 164353, 215312, u2026
SY-ZONLO
Useru2019s time zone, for example, EST, UTC, u2026