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

When time has reached

Former Member
0 Likes
1,001

Hi all,

I want to control the flow of code part depending on the time passed.

For example when passed time reached up to 20 seconds,I want to disappear a button on the screen.

I have controlled time as the difference of what has done between two events(click).If this difference is > 20, made button disappeared.

But I want to do it when difference is ok. Without need to click second time.

When clicked for example on execute, if he did not use a button for 20 seconds, just make it disappear.

How can I do this auto-triggering?

Thanks.

Deniz.

1 ACCEPTED SOLUTION
Read only

naveen_inuganti2
Active Contributor
0 Likes
957

Hi... Deniz...

Good thought...

But.. I think its not posible with ABAP.

We can these kind of things only with Mark-up languages.

For example we will take a small code ..

> do 100 times.

> write:/ SY-UZEIT.

> enddo.

Here if you put break point for DO statements... stay 1 hour in that mode..... but we can get first excution time only as output!

The system field SY-UZEIT can't change in runtime.

But if you want to disapper that button in one perticuler time width always.. it is possible...

Ex: We can post documents on month ending date auto matically in the end of the month with reports.

Get back to you if i got any Idea on this...

Thanks,

Naveen Inuganti,

8 REPLIES 8
Read only

naveen_inuganti2
Active Contributor
0 Likes
958

Hi... Deniz...

Good thought...

But.. I think its not posible with ABAP.

We can these kind of things only with Mark-up languages.

For example we will take a small code ..

> do 100 times.

> write:/ SY-UZEIT.

> enddo.

Here if you put break point for DO statements... stay 1 hour in that mode..... but we can get first excution time only as output!

The system field SY-UZEIT can't change in runtime.

But if you want to disapper that button in one perticuler time width always.. it is possible...

Ex: We can post documents on month ending date auto matically in the end of the month with reports.

Get back to you if i got any Idea on this...

Thanks,

Naveen Inuganti,

Read only

0 Likes
957

Hi Naveen and thanks,

I want to use this auto-triggering as CTRL + Z, that is, undo event. I have coded it through a button on screen numbered as 100.

If the user did not use this button for 20 seconds, I want to make it disappear automatically.

Thanks a lot.

Deniz.

Read only

0 Likes
957

i can probably help you how to do it using webdynpro abap but i don't think it is possible using standard abap reports...

in webdynpro you can use the timedtrigger control and can refresh your view automatically after a certain amount of time has passed.....

in traditional abap i don't think there is any such refresh possible for a selection screen or a module pool screen....u can determine how much time has passed by capturing the sy-uzeit variable at different points of time and calculating the difference....but you will have to write your code to make the button invisible in some event that has to be initiated by the user....

i will also suggest that in case you want that whatever action your button does should not be done after 20 seconds, then probably you can check on the click of the button that how much time has passed....you can do this by first capturing the value of sy-uzeit when your program starts and then when the button is clicked...

if the difference is found to be 20 secs or more, you can write an if condition so that your code is not executed...

just some suggestions.....don't think the button invisibility can be automatic

Read only

0 Likes
957

Hi.. Priyank.....

Thanks for your attention...

What you said is exactly correct.., we can do it if user interacting with screen....

Hi friends Please share your valuebale ideas on this...

Can we disappear a button on module pool screen after certain time with out user interaction with screen?

Thanks,

Naveen Inuganti.

Read only

0 Likes
957

Not by means of classic ABAP. With OO ABAP I'm not sure, but if there is no event or user interaction of any kind, I can't see how this could be done.

Things like auto log off after x minutes of inactivity are all done on the kernel or OS level, as far as I know.

Thomas

Read only

Former Member
0 Likes
957

hi do like this....

use this .....

get time .

get time stamp field v_var1

Read only

0 Likes
957

Hi.... Venkat...

Can you please xplain how it can be possible with time stamp...??

Hmmmm... venkat is guest!!

And..,

Hi.. Deniz...

Here I understtod your requirement actually... But what iam saying with my frist reply is... We can not change screen automatically with out user interaction.....by using ABAP coding..,

And...

I think you are aware of WAIT UP TO N SECONDS statement...

c this code...

>do 10 times.

>wait up to 1 seconds.

>write:/ sy-uzeit.

>enddo.

which can give output after 10 secs...

02:00:13

02:00:14

02:00:15

02:00:16

02:00:17

02:00:18

02:00:19

02:00:20

02:00:21

02:00:22

and one more thing...

It may be possible if user presses other buttons in that screen....

we can write code for this...

with that we can disable that button after certain time...

I think you can do it or If you want I can suggest logic for this...

ANY BODY MORE IDEAS ON THIS REQUIREMENT

Thanks,

Naveen Inuganti.

Read only

Former Member
0 Likes
957

Hi Deniz,

That's very interesting question.

Although I haven't tried it, I guess following should work

You write a FM and call it in asynchronous mode in PBO of screen. Use starting new task. In this FM write logic for waiting 20 seconds

set a flag to indicate if PBO is called first time of called implicitely.

CALL FUNCTION func STARTING NEW TASK task

DESTINATION dest

parameter_list

PERFORMING subr / CALLING meth ON END OF TASK

In call back routine (PERFORMING subr) call the screen again.

Check the flag and if it is set do not call function

In PAI set another flag to indicate if user has performed some action.

Check this flag in subroutine SUBR and if set do not call the screen again.

Let me know if above logic works. I haven't tried it myself yet.

Regards,

Mohaiyuddin

Edited by: Mohaiyuddin Soniwala on Aug 1, 2008 3:41 PM