‎2009 Apr 16 2:49 PM
HI all,
My issues is as follows. I am backflushing a Serial Number & Material.
I'm giving the sceudo code to explain the issue more clearly.
Call funtion 'RM_BACKFLUSH_GO'
importing
parameter = lv_mat_doc
if sy-subrc = 0.
commit work and wait.
information message to user
do 3 times
select tbnum from mseg into lv_tbnum where mblnr = lv_mat_doc
if sy-subrc = 0.
exit.
else
wait up to 2 seconds.
endif.
enddo.
do 3 times.
select tanum from ltbp where tbnum = lv_tbnum
if sy-subrc = 0.
exit.
else.
wait up to 2 seconds.
endif.
enddo.
do 3 times.
select nlenr from ltap where lanum = lv_tanum
if sy-subrc = 0.
exit
else.
if sy-index = 3.
error message.
endif.
wait up to 2 seconds.
endif.
enddo.
endif.
The select statement in bold letters(3rd) is failing in normal program execution. but the same select is working fine when i am running the program in debugging mode or give an information message(striked above) to the user. I think the problem is I'm accessing LTAP table before an entry is made by the system(thru function module above). User don't want the information message to be displayed and i increase the time lag even up to 30 seconds by do 15 times its not working. So, I'm stuck.
Can anybody please let me know, how can I fix this problem.
Thanks n Regards
Maruthi
‎2009 Apr 16 2:53 PM
hi,
Make a COMMIT WORK AND WAIT or call FM BAPI_TRANSACTION_COMMIT before your select..
Issa
‎2009 Apr 16 2:55 PM
Hi,
It seems that the execution is faster so it is not waiting until the FM retrives data.
Try like below.I
Commit work.
wait up to 2 seconds.
Thanks,
Vamshi
‎2009 Apr 16 3:14 PM
i tried as follows
do 3 times.
select statement
if sy-subrc = 0
exit.
else.
commit work and wait
if sy-index = 3.
error message
endif.
wait up to 2 seconds.
endif.
enddo.
still its not working......
‎2009 Apr 16 2:58 PM
Instead of Information(I) message give a Success(S) message ...
‎2009 Apr 16 3:03 PM
User don't want any type of message.
let me try with commit work before select statement.
‎2009 Apr 16 3:04 PM
use commit work and wait.
In this increase the wait time.
Regards,
Lalit Mohan Gupta.
‎2009 Apr 28 8:10 PM