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

Problem in BAPI_BUS2001_SET_STATUS

Former Member
0 Likes
1,191

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.

4 REPLIES 4
Read only

Former Member
0 Likes
736

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

Read only

0 Likes
736

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.

Read only

0 Likes
736

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

Read only

roland_spindler
Participant
0 Likes
736

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