Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV

Former Member
0 Likes
560

Hi experts,

can u tl me how to add clock(time) in footer and i want to refresh for each and every second.

i mean it displays the time.

thanks in advance.

Hi experts,

can u tl me how to add clock(time) in footer and i want to refresh for each and every second.

i mean it displays the time.

thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
539

HI

CLOCK ON SCREEN. (Thru write statement)

(This sample code will give an insight

to many abapers who are still wondering

about the concept of TIMER IN ABAP

as compared to other programming languages)

(Timer in ABAP was also a mystery to me

some time back ago)

The Code : (Just Copy Paste)

REPORT abc NO STANDARD PAGE HEADING.

DATA : wa(72) TYPE c.

*----


CLASS my DEFINITION.

PUBLIC SECTION.

METHODS : run_handler FOR EVENT finished OF cl_gui_timer.

ENDCLASS. "my DEFINITION

DATA timer TYPE REF TO cl_gui_timer.

DATA myh TYPE REF TO my.

----


  • CLASS my IMPLEMENTATION

----


*

----


CLASS my IMPLEMENTATION.

METHOD run_handler.

CALL METHOD timer->run.

PERFORM mylist.

ENDMETHOD. "run_handler

ENDCLASS. "my IMPLEMENTATION

*----


*----


Init

INITIALIZATION.

CREATE OBJECT timer.

CREATE OBJECT myh.

SET HANDLER myh->run_handler FOR ALL INSTANCES.

  • PARAMETERS : a TYPE c.

*----


End of selection

START-OF-SELECTION.

WRITE sy-uzeit TO wa.

WRITE wa.

timer->interval = '0.5'.

CALL METHOD timer->run.

*----


FORM mylist.

WRITE sy-uzeit TO wa.

MODIFY LINE 1 LINE VALUE FROM wa.

ENDFORM. "MYLIST

Read only

0 Likes
539

thank you for ur reply,but i don't know abt the OOP's concept.

can u tell me by using nay function modules etc.

Read only

Former Member
0 Likes
539

HI,

see this example.

write:/ 'example'.

DO 60 TIMES.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = sy-index

TEXT = sy-index.

WAIT UP TO 1 SECONDS.

ENDDO.

rgds,

bharat.

Read only

0 Likes
539

Hi Bharat,

thanks for reply,but it is not my exact solution.

i want to display the timer in output of grid display.

i hope u can understand.