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

BAPI_PROJECT_MAINTAIN

Former Member
0 Likes
935

I am adding an Activity to an existing Project and BAPI_PROJECT_MAINTAIN is getting an error. The BAPI cannot add the Activity. The error is being detected in Function Module CO2O_ACTIVITY_CREATE_STRU. The import parameters contain a parameter called I_AFVGD_NEW that is like structure AFVGD. In the first IF statement a field in I_AFVGD_NEW called UVORN. This field is, according the Data Dictionary, SubOperation. The field is not populated from any of the BAPI Input Tables and being blank the CREATE_ELEMENT flag is not set. This causes the AFVGD structure to be cleared. This structure is checked in line 92 and an error message is created.

Is the Field UVORN relevant to this process? Should an enhancement be made to include UVORN in the inbound data structure to the BAPI? Since UVORN is related strictly to the Work Order, does a Work Order have to be created before the Activity can be added to the Project?

7 REPLIES 7
Read only

Former Member
0 Likes
825

Hi,

You cannot create activity without creating network. For creating network pass temporary 12 digit no in network field and Project defn. While creating activity simultaneously, pass this temp network no. If you are creating activity after commit ie after creation of network, pass the new network no generated by system.

Regards

Read only

0 Likes
825

Sorry, I did not fully explain that the Project/Network are already established. This Activity is being added to the Project/Network.

Read only

Former Member
0 Likes
825

The Activity is being added to an existing Project/Network.

Read only

Former Member
0 Likes
825

Hi,

I am not an ABAPer but can assure you the following:

1. As per you following comment it seems that you are entering activity details in I_ACTIVITY_ELEMENT whereas you should enter in I_ACTIVITY

This field is, according the Data Dictionary, SubOperation. The field is not populated from any of the BAPI Input Tables and being blank the CREATE_ELEMENT flag is not set.

The above sentence tells that if suboperation is blank, system doesnt set the flag for creating activity element.

2. Passing existing network no and new activity no in I_ACTIVITY along with existing project defn should create new activity.

Regards

Read only

0 Likes
825

I removed the Activity number from I_Activity. I got the same error. I removed the Activity number from the object key in I_METHOD_PROJECT. I got the same error. I then replaced the Activity number with Zeros and it told me zero is invalid.

Read only

0 Likes
825

For creating activity in existing netwrok you need to pass the following:

1. Existing network number in I_NETWORK, prefix zeros to make it 12 digit. Pass the same 12 digits as object key. Method for network should be update.

2. Existing Network number and new activity number in I_ACTIVITY, along with WBS and Proj Defn. Method should be create. Also make sure that the activity number doesnt exist in the network. For eg network 12345 has 0010, 0020 activities: you need to use 0030 number for new activity. You can check that in CJ20N tcode by opening netwrok. Make sure to close this transaction before running the BAPi.

Regards

Read only

0 Likes
825

I checked the NETWORK and ACTIVITY formats and there is no place for Method. I am now getting a error message that the Network/Activity Object key is invalid.