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

abap insert commit issue

former_member229036
Participant
0 Likes
698

Dear Guru!!

i have two issue regarding commit issue.

#1. there is one RFC for synchronous has insert statement and then commit

but disappear data with mass calling RFC, it seems to be not committed .

  insert into zcct002 values gs_log.

  commit work.

#2. there is one RFC for receiving data.

   firstly execute select statement for getting data inserted by above #1 RFC .

   but when selecting performed ,, Sometime  ABAP does not pick it up from that table even though a record inserted into table at almost same time.

   wait up to 1 seconds for 3 times, it does not work.  sometime comes to same issue

   if sy-subrc <> 0.

     do 3 times.

       wait up to 1 seconds.

       select single *

         from zcct002

         into gs_log

         where modid  = gs_appr_in-modid

           and objkey = gs_appr_in-objkey

           and docid  = gs_appr_in-docid.

       if sy-subrc = 0.

         exit.

       endif.

      enddo.

    endif.

3 REPLIES 3
Read only

former_member223133
Active Participant
0 Likes
625

Hi David,

It seems like an issue with COMMIT. Try with the below options.

  1. In 1st RFC FM, check sy-subrc after insert statement and commit. Then write a statement "wait up to 3 seconds."
  2. For 2nd RFC, increase the wait time for 3 seconds.

Thanks

Gangadhar

Read only

ThangaPrakash
Active Contributor
0 Likes
625

Hello David,

Try to close the first RFC connection after the Insert and commit using the FM "RFC_CONNECTION_CLOSE".

Might be first RFC is not closed and it means the execution has not completed, so the data has not been updated in table or the RFC connection might have stuck. So it is better you close the first RFC connection after the insert

Regards,

Thanga Prakash T

Read only

Katan
Active Participant
0 Likes
625

Have you tried "commit work and wait"?  If you need these records to be commit before processing any further, then you should use this.  It will ensure your high priority updates are executed synchronously and processing will not continue until the update is complete.  Note your RFC will hang until this has happened.  

As you are using just "commit work".  This pushes the commit on an asynchrounous queue and it will be processed whenever the system has bandwidth to do so.  The time it takes to perform this is relative to the available load on the system and the number of processes allocated to updates.