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

Issue with looping for time..

Former Member
0 Likes
364

Hello Gurus,

I am trying to work on situation where I have to wait for 2 seconds time in a loop until a event is created. I am using following looping but it does not work at all. The program exists as soon as it encounters loop.

loop.

        g_ptsevent = 'Start'.
        CALL FUNCTION 'SWE_EVENT_CREATE'
          EXPORTING
            objtype           = g_ptsobject
            objkey            = g_ptsobjid
            event             = g_ptsevent
          IMPORTING
            event_id          = g_idevent
          EXCEPTIONS
            objtype_not_found = 1
            OTHERS            = 2.


        if v_idevent is initial.
          WAIT UP TO 2 SECONDS.
        else.
          exit.
        endif.

      endloop.

Regards,

Rajesh.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
339

should

if v_idevent is initial.

rather be

if g_idevent is initial.

?

Hello Gurus,

I am trying to work on situation where I have to wait for 2 seconds time in a loop until a event is created. I am using following looping but it does not work at all. The program exists as soon as it encounters loop.

loop.

        g_ptsevent = 'Start'.
        CALL FUNCTION 'SWE_EVENT_CREATE'
          EXPORTING
            objtype           = g_ptsobject
            objkey            = g_ptsobjid
            event             = g_ptsevent
          IMPORTING
            event_id          = g_idevent
          EXCEPTIONS
            objtype_not_found = 1
            OTHERS            = 2.


        if v_idevent is initial.
          WAIT UP TO 2 SECONDS.
        else.
          exit.
        endif.

      endloop.

Regards,

Rajesh.

1 REPLY 1
Read only

ThomasZloch
Active Contributor
0 Likes
340

should

if v_idevent is initial.

rather be

if g_idevent is initial.

?