‎2007 Sep 19 9:08 AM
hai
i am trying to to create a project and wbs elements using bapi_project_maintain in my report, so i called he bapi for project definition and then for wbs elements
but the problme is that if i give both inputs the project definition and wbs elements it is giving error that the project is currently being edited,
i used the bapi_transaction_commit and also commit work and wait after each call even then it is giving same error, if i pass project first and then if i create wbs it is working fine , but at a time it is giving problem can any one tell me the suitable solution
regards
afzal
‎2007 Sep 19 9:14 AM
Insert <b>SET UPDATE TASK LOCAL</b> statement before BAPI call, in that case all the locks will be definetely released after COMMIT WORK.
‎2007 Sep 19 9:51 AM
hai i tried but i am gettign same error
i mean i used the set update local before calling the bapi
is is right or not
please reply me
SET UPDATE TASK LOCAL .
CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
EXPORTING
I_PROJECT_DEFINITION = IT_PROJECT_DEFINITION
I_PROJECT_DEFINITION_UPD = IT_PROJECT_DEFINITION_UPD
TABLES
I_METHOD_PROJECT = IT_METHOD_TABLE
I_WBS_ELEMENT_TABLE = IT_WBS_ELEMENT_TABLE
E_MESSAGE_TABLE = IT_MESSAGE_TABLE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
COMMIT WORK AND WAIT.
SET UPDATE TASK LOCAL .
CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
EXPORTING
I_PROJECT_DEFINITION = IT_PROJECT_DEFINITION
I_PROJECT_DEFINITION_UPD = IT_PROJECT_DEFINITION_UPD
TABLES
I_METHOD_PROJECT = IT_METHOD_TABLE
I_WBS_ELEMENT_TABLE = IT_WBS_ELEMENT_TABLE
E_MESSAGE_TABLE = IT_MESSAGE_TABLE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
COMMIT WORK AND WAIT.
i used like this code for two times one for project definition and then for wbs elements