‎2011 Nov 10 8:26 PM
Hi Friends,
I am creating projects using BAPI 'BAPI_PROJECTDEF_CREATE' and passing these Projects to BAPI 'BAPI_PROJECT_MAINTAIN'
for creating WBS elements. but when i am uploading legacy data throuch my program to create projects and WBS elemets throrch IDOC Process, sometimes i am getting an IDOC ERROR is " Project is currently being processed " is coming in IDOC status 51. but when i am see in proj table the failure idocs projects are created.
i am written 'BAPI_TRANSACTION_COMMIT' only after BAPI 'BAPI_PROJECTDEF_CREATE not for BAPI BAPI_PROJECT_MAINTAIN.
so if i write 'BAPI_TRANSACTION_COMMIT' after BAPI 'BAPI_PROJECT_MAINTAIN' the above error will be solved?
Kindly advice.
Regards,
Kumar.
‎2011 Nov 10 8:54 PM
Check the user from the return message who is currently processing the Proj def. If its the same user the Idoc's are processed by, then you have to check for the locking of the Proj before 'BAPI_PROJECT_MAINTAIN' and some logic to delay and check again if lock is released for limited number of times.
‎2011 Nov 11 1:13 AM
Hi,
I would suggest you to use COMMIT after each BAPI call but this can hinder your performance as well. So please before applying that.
Also, call BAPI_PROJECT_MAINTAIN inside a DO loop like DO 3 TIMES and if it returns that project is locked, apply some delay using WAIT statement. If not, then simply exit the DO loop and proceed,
Thanks.
Ravi
‎2011 Nov 11 7:33 AM
Hi,
This is a very common problem in PS (Project Systems) during the creation of projects. Actually the cause of this is, once you have created the project, there are a number of database updates going on in the background corresponding to the new project that has been created. Even before all these updates are over, your program is calling the function module to create the WBS elements under it. Hence the message comes as the 'Project is currently being processed by 'user ID (your user ID)'.
In order to avoid this keep a 'Wait until 2 seconds' statement after you have used BAPI_TRANSACTION_COMMIT' for project creation and before calling the function module to create WBS elements under the project. This will solve the problem.
‎2011 Nov 11 10:29 AM
Hi Friend,
Thanks for your reply.
Now its working fine..... thanks alot....
regards,
Kumar.