‎2005 Aug 24 2:19 PM
Dear friends,
I have problem in BAPI_BUS2001_SET_STATUS. I am not able to set status of a project defination as REL which is created using BAPI_PROJECT_MAINTAIN. It is giving me the error message that project defination is not initial.
‎2005 Aug 24 2:35 PM
Hi,
You need to call this in sequence:
TO CREATE PROJECT DEFINITON
CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
EXPORTING
project_definition_stru = l_wa_bapi_project_definition
IMPORTING
return = l_i_bapireturn1
TABLES
e_message_table = l_i_bapi_meth_message.
COMMIT WORK.
TO CREATE WBS-ELEMENT.
CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
EXPORTING
i_project_definition = fp_l_bapi_project_definition
i_project_definition_upd = l_i_bapi_project_definition_up
IMPORTING
return = l_i_bapireturn1
TABLES
i_method_project = fp_l_i_bapi_method_project
i_wbs_element_table = fp_l_i_bapi_wbs_element
e_message_table = l_i_bapi_meth_message
.
COMMIT WORK.
regards
Aveek
‎2005 Aug 24 2:57 PM
dear aveek,
i have created project definition, wbs element, network header, activity , avtivity element, and mile stone.
i am able to set the status of project definition which i have created using bapi_project_maintain when i set it directly usin the tcode cj20n -> edit -> setstatus.
but if i want to set the status by usin bapi, it is giving me error as project definition is not initial.
‎2005 Aug 24 5:18 PM
Hi,
For the WBS update you can refer to the documentation in SAP:
Command: Update
Use this command to change a WBS element that already exists in the R/3 Project System. If you enter an update structure, you can change individual fields without having to specify the other fields.
Example
- Changing the description of the WBS element TRAINING.1 for the project definition PD TRAINING
IMethodProject
OBJECTTYPE = WBS element
METHOD = Update
OBJECTKEY = TRAINING.1
REFNUMBER = 000001
OBJECTTYPE =
METHOD = Save
OBJECTKEY =
REFNUMBER =
IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING
IWbsElementTable
Index = 1
WBS_ELEMENT = TRAINING.1
PROJECT_DEFINITION = PD-TRAINING
DESCRIPTION = Preparation and documentation
IWbsElementTableUpdate
Index = 1
WBS_ELEMENT =
PROJECT_DEFINITION =
DESCRIPTION = X
regards
Aveek
‎2006 Sep 12 8:36 AM
Hello,
You have to call BAPI_PS_INITIALIZATION before setting the status and BAPI_PS_PRECOMMIT between setting the status and Commit.
best regards
Roland