‎2013 May 16 8:01 AM
Hello all,
I am writing a module pool program wherein the user has to answer a few questions in a certain period of time (say 10 minutes). At the top left hand corner, a timer has to be displayed which shows the remaining time left for the questions to be answered. Can someone please help me how to do this without using ABAP OOPS as am not familiar with it. Thanks.
‎2013 May 16 8:31 AM
This has nothing to do with ABAP Objects. You can write module pool programs with or without oop techniques. (I do suggest that you become familiar with ABAP Objects as it is increasingly becoming a necessary skill).
However, what you are requesting is not really possible. Web Dynpro is the sensible approach. That has a timer component. You can run web dynpro applications in SAPGui.
matt
‎2013 May 16 8:31 AM
This has nothing to do with ABAP Objects. You can write module pool programs with or without oop techniques. (I do suggest that you become familiar with ABAP Objects as it is increasingly becoming a necessary skill).
However, what you are requesting is not really possible. Web Dynpro is the sensible approach. That has a timer component. You can run web dynpro applications in SAPGui.
matt
‎2013 May 16 8:41 AM
Check the blog below, it uses the class CL_GUI_TIMER -
http://aaabap.blogspot.com/2011/02/abap-timer-part-3.html
Cheers!
Abhinab
‎2013 May 17 7:34 AM
Thanks Abhinab, but unfortunately I dont know ABAP OOPS as I mentioned before. So I cant understand the contents of the link which deals with methods, classes etc.
‎2013 May 17 8:29 AM
Well, I stand corrected. I was not aware of this class. It's nice to learn something new!
‎2013 May 16 8:58 AM
Hi Manish,
You can create an FM and call it in separate task and on finish of timer you can trigger.
THIS FM should be RFC Enabled
FUNCTION ZTIMER.
DATA: ZTIME LIKE SY-UZEIT.
GET TIME.
ZTIME = SY-UZEIT + 300.
DO.
GET TIME.
IF SY-UZEIT >= ZTIME.
EXIT.
ENDIF.
ENDDO.
ENDFUNCTION.
Then in begining of your Program call this FM.
CALL FUNCTION 'ZTIMER'
STARTING NEW TASK 'ZTIMER'
PERFORMING END_TIMER ON END OF TASK.
Write a Perform "END_TIMER" to do what you want on finish.
Cheers
‎2013 May 17 7:41 AM
Hi Manish,
You can use class CL_GUI_TIMER. Check this example:
SAP Community Network Wiki - Code Gallery - Automatic Data Refresh on Module pool Screen
Regards,
Custodio
@zcust01
‎2013 May 17 7:46 AM
And you can also check standard program SAP_TIMER_DEMO.
cheers,
Custodio
@zcust01
‎2013 May 17 8:41 AM
Hi
.
Use below logic.
Data: t11 type tzonref-tstamps,
t12 type TZONREF-TSTAMPL,
v_t11 type tzonref-tstamps,
v_t12 type TZONREF-TSTAMPL.
GET TIME STAMP FIELD t11.
GET TIME STAMP FIELD t12.
v_t11 = t1..
v_t12 = t12.
clear:t12, t11.
GET TIME STAMP FIELD t11.
GET TIME STAMP FIELD t12.
difference between v_t11 to t11 or v_t12 to t12.
check with session time with diff time.
After that call FM (p_time should time diff)
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = p_time
text = p_stage.
Better put this logic in NEXT button which one you use to move question to another question.
Thanks.
NJ
Message was edited by: nagaraj j