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...

Former Member
0 Likes
1,973

Hi,

WAIT UP TO 10 SECONDS. is used in one of the program.

as suggested by SAP we should not use the WAIT statement.

what is the replacement statement for the WAIT statement.

I understood from the documentation of the program, that statement is using because he is creating and updating the same material using bdc.

that statement accours after creation of material and before the updation of material.

give me the correct replacement statement for WAIT UP TO 1 SECONDS.

regards,

sunny

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,434

HI,

Use COMMIT WORK AND WAIT.

Also in the BDC use 'S' for synchronous update.

Regards,

Ankur Parab

Edited by: Ankur Parab on Aug 8, 2009 6:07 PM

4 REPLIES 4
Read only

Former Member
0 Likes
1,435

HI,

Use COMMIT WORK AND WAIT.

Also in the BDC use 'S' for synchronous update.

Regards,

Ankur Parab

Edited by: Ankur Parab on Aug 8, 2009 6:07 PM

Read only

Former Member
0 Likes
1,434

hi sunny,

just to add some points to what ankur has suggested:

your program is having that WAIT FOR 10 SECONDS because they might be reading or handling the data after the data is being updated in the database table, and to pass the value actually to data base actually need a commit work. which can either triggered with a COMMIT WORK statement or a completion of LUW (Logical Unit of Work). and this update needs some seconds some time.

so in place of using wait for 10 secs you can use COMMIT WORK and WAIT as suggested by Ankur too.

Read only

Former Member
0 Likes
1,434

Hi Sunny,

Commit work and wait is one way .

OR.

Just to be sure of the updation of data in database, you can use a manual lock CODE as follows.



  Do .
  ***Following select is just an example.Change acc to ur requirement.
  Select Matnr
    from mara
   ...............................

   if sy-subrc = 0.
     EXIT.
   endif.
  Enddo.

  

Regards,

Vimal.

Read only

former_member156446
Active Contributor
0 Likes
1,434

>

> he is creating and updating the same material using bdc.

>

> that statement accours after creation of material and before the updation of material.

if he is updating or creating a material... you check if the change has reflected in the DB table using: select single matnr from mara where matnr = itab_data-matnr. if sy-subrc eq 0.. then proceeed furture.. use this in a DO ENDDO.. so exit once the sy-subrc from the select is 0.

DO.
select single matnr from mara where matnr = itab_data-matnr.
if sy-subrc eq 0. " this would be 0 only if the update has occured.. 
exit.
endif.
enddo.