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

creating a project

Former Member
0 Likes
326

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

2 REPLIES 2
Read only

sergey_korolev
Active Contributor
0 Likes
300

Insert <b>SET UPDATE TASK LOCAL</b> statement before BAPI call, in that case all the locks will be definetely released after COMMIT WORK.

Read only

0 Likes
300

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