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

WAIT statement NOT WORKING

Former Member
0 Likes
2,510

Hi all,

After the below WAIT statement gets executed, I am getting sy-subrc = 4,

WAIT UNTIL 1 = 2 UP TO 10 SECONDS. " ACCEPTABLE IN VERSION 31H

I cannot use below statement as my version (31H) doesn't accept it:

WAIT UP TO 10 SECONDS. " NOT ACCEPTABLE IN VERSION 31H

I have checked the same statement WAIT UNTIL 1 = 2 UP TO 10 SECONDS. in ECC 6.0. but even there, it is NOT WORKING...!!!

Please suggest me what to do. My requirement is to STOP PROGRAM EXECUTION FOR 10 SECONDS

Thanks in advance

Vasu

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,701

"WAIT UNTIL log_exp UP TO sec SECONDS." waits until the logical expression is true OR every asynchronous call has been executed OR time elapsed.

If you did not execute any asynchronous call WAIT ends immediately and SY-SUBRC is set to 4.

Meanings of sy-subrc

0 The logical condition log_exp was fulfilled.

4 No asynchronous function calls exist.

8 With specification of the addition UP TO, the maximum time was exceeded.

In latest version the "WAIT UP TO sec SECONDS." can be used independently of any asynchronous call, but in 3.1H, look for FM containing WAIT or DELAY. (I don't have a 3.1H at hand)

- SWE_CD_TST_DELAY

- TH_DELAY_FUNC_TEST

- C14Z_WAIT_N_SECONDS

Regards,

Raymond

8 REPLIES 8
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,701

just a try ..

work it with FM and check

C14Z_WAIT_N_SECONDS

Read only

0 Likes
1,701

Function Module 'C14Z_WAIT_N_SECONDS' is working fine but is not available in my version. Please provide me any other alternative.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,702

"WAIT UNTIL log_exp UP TO sec SECONDS." waits until the logical expression is true OR every asynchronous call has been executed OR time elapsed.

If you did not execute any asynchronous call WAIT ends immediately and SY-SUBRC is set to 4.

Meanings of sy-subrc

0 The logical condition log_exp was fulfilled.

4 No asynchronous function calls exist.

8 With specification of the addition UP TO, the maximum time was exceeded.

In latest version the "WAIT UP TO sec SECONDS." can be used independently of any asynchronous call, but in 3.1H, look for FM containing WAIT or DELAY. (I don't have a 3.1H at hand)

- SWE_CD_TST_DELAY

- TH_DELAY_FUNC_TEST

- C14Z_WAIT_N_SECONDS

Regards,

Raymond

Read only

0 Likes
1,701

I am using 'WAIT UNTIL 1 = 2 UP TO 10 SECONDS' after statement 'close dataset w_pgpcheckfile.'. Is it not valid?

Read only

0 Likes
1,701

There will be no "wait" time, look at [WAIT UNTIL|http://help.sap.com/abapdocu/en/ABAPWAIT_UNTIL.htm] and at [RFC - Remote Function Call in Release 3.0 |http://help.sap.com/abapdocu/en/ABENNEWS-30-RFC.htm#!ABAP_MODIFICATION_2@2@]

The WAIT UNTIL condition [UP TO n SECONDS] statement allows you to wait for a function module, called asynchronously, to finish. To do this, use the PERFORMING form ON END OF TASK addition. WAIT must occur in the same program context (session).

Regards,

Raymond

Read only

0 Likes
1,701

Hi Raymond,

I have copy pasted the code in FM SWE_CD_TST_DELAY and it worked in my version.... Thanks!!!

Read only

Former Member
0 Likes
1,701

Hi Vasu,

sy-subrc = 4 => No asynchronous calls exist.

I guess, to use Until addition, u need a asynchrounous update to be happening...

as u dont have a wait upto x secs...

try using a loop...

do.

check start time.

lapsed time = current time - start time.

if lapsed time ge 10 secs.

exit.

enddo.

Regards,

Bikash

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,701

check this

link:[wait until|http://help.sap.com/saphelp_nwpi71/helpdata/en/c6/13a228e9c5ca469fe7065387dc87be/content.htm]