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

Strange issues with select statement after FM execution.

Former Member
0 Likes
890

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

7 REPLIES 7
Read only

Former Member
0 Likes
851

hi,

Make a COMMIT WORK AND WAIT or call FM BAPI_TRANSACTION_COMMIT before your select..

Issa

Read only

Former Member
0 Likes
851

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

Read only

0 Likes
851

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

Read only

Former Member
0 Likes
851

Instead of Information(I) message give a Success(S) message ...

Read only

0 Likes
851

User don't want any type of message.

let me try with commit work before select statement.

Read only

Former Member
0 Likes
851

use commit work and wait.

In this increase the wait time.

Regards,

Lalit Mohan Gupta.

Read only

Former Member
0 Likes
851

solved myself