cancel
Showing results for 
Search instead for 
Did you mean: 

Read-Write-Read Issue

Former Member
0 Kudos

Well, I am officially about to go insane trying to fix this problem. Here is the situation:

From WebDynpro Java we call a function module. That function module does the following in order to write a new "vacation" absence:

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

CALL FUNCTION 'BAPI_CATIMESHEETMGR_INSERT'

COMMIT WORK AND WAIT

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

CALL FUNCTION 'HR_INITIALIZE_BUFFER'

After the vacation record is written, we execute a view operation to see the newly changed or inserted record. It calls this function among others to read the records:

CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'

But it does not show the updated records! If I insert a WAIT operation for some seconds between the write and the read, then the updated records do show up.

We cannot move this solution to production because an arbitrary WAIT time is not an acceptable production-quality solution.

Why doesn't COMMIT WORK AND WAIT do what it says it does? How do I wait for the database update to complete before ending the RFC call? Nothing seems to work (I tried a lot of different RFC's and COMMIT WORK statements).

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

We ended up inserting a WAIT n SECONDS. This is a bad design, but appears to work.