02-04-2014 1:14 PM
Hi,
I am running BDC for F-04 to cear and post the documents. There i put WAIT UP TO 3 SECONDS after creation of every document as it was throwing the error 'Transaction F-04 is currently blocked by the same user running the program'.
But suppose I am clearing and posting large number of documents then it is taking time. Suppose I clear and post 200 docs then will there be a delay of 600 seconds when it'll run in the background ? If we consider straightforward calculation in background as 200*3 = 600.
What would be the best solution to avoid above error and how much the WAIT should I place ?
Thanks.
02-04-2014 2:14 PM
Try to temporarily lock the transaction required object (transaction, account ?), analyze with SM12 to find the lock object used and the function module * ENQUEUE_ associated. Call this module with the WAIT option, if necessary in a DO / ENDDO loop. once locked object, release it with the DEQUEUE_ *function module and run the following CALL TRANSACTION.
Yoyu could also read 1802551 - Error message F5287 "Account & & is currently blocked by user &" when posting and/or clear...if that is the correct error message ?
Regards,
Raymond
02-04-2014 1:21 PM
02-04-2014 1:53 PM
Hi,
I am not using any Bapi but using call transaction for F-04.
Can i avoid this error of user locking by avoiding wait?
Thanks
02-04-2014 1:59 PM
Hi,
Use below BAPI to do your code and you will not face this issue.
BAPI_ACC_DOCUMENT_POST.
Raghav
02-04-2014 2:16 PM
Hi,
If i can't use this bapi then what could be the alternative to avoid this issue.
Thanks.
02-04-2014 2:28 PM
Then try out what Raymond says.
BAPI's are always the best way to do this.
02-04-2014 2:14 PM
Try to temporarily lock the transaction required object (transaction, account ?), analyze with SM12 to find the lock object used and the function module * ENQUEUE_ associated. Call this module with the WAIT option, if necessary in a DO / ENDDO loop. once locked object, release it with the DEQUEUE_ *function module and run the following CALL TRANSACTION.
Yoyu could also read 1802551 - Error message F5287 "Account & & is currently blocked by user &" when posting and/or clear...if that is the correct error message ?
Regards,
Raymond
02-05-2014 6:12 AM
Hi Raymond,
I have gone through that SAP Note, I am getting the same error if I don't put WAIT after creation of one document. Note is saying that SAP itself locks few FI transactions including F-04 to avoid postings in same GL from different/same users. If this facility is available then where exactly I should use lock object ?...If I am using wait in the lock object then It'll again increase delay.
Can't COMMIT WORK AND WAIT works similarly as wait up to?...Can I use that instead ?
Thanks.
02-05-2014 9:28 AM
A COMMIT-WORK AND WAIT will actually wait until every update task is executed and so every lock kept in those task is released, BUT () only if executed in the luw/program that called the update task, so it will be of no interest at all to execute such a commit after a CALL TRANSACTION (*), it can be used when you called a BAPI.
Try to analyze the locks with SM12 (or analyzing standard code or error log during tests) during the transaction execution and then identify the ENQUEUE (**) FM as I wrote in previous answer.
Pseudo-code
Loop
if new vendor/customer is same id than previous one
try to lock vendor/customer with wait option in a do/enddo loop until successful, you can limit iterations in case of severe performance problem
release lock
end if
create BDCDATA
execute transaction
memorize last vendor/customer
End of loop
Regards,
Raymond
(*) The transaction will have raised a COMMIT without WAIT option itself before your driver program...
(**) The "applicant" FM are listed in the note, e.g. ENQUEUE_EFKNB1A
02-04-2014 3:00 PM
Hi,
Instead of wait up to..., you can try using "COMMIT WORK AND WAIT".
Regards,
Munesh.
02-05-2014 7:20 AM