cancel
Showing results for 
Search instead for 
Did you mean: 

How to Programmaticlly Retrieve BP assigned to a cProject Role

ramki_maley
Active Contributor
0 Kudos

Hello Folks,

I am working on a workflow for a custom object in a xRPM/cProjects 4.5 environment. I need to find the Business Partners (and their User ids) given a Role Name (id) and the external id of the cProject. Are there any BAPIs that I could use to get the information needed? If not what are the tables I need to read? I tried SQL trace but was not successful in finding the necessary relations between the DB tables.

Cheers,

Ramki.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I don't remember the BAPI names, but you should be able to retrieve some of them by searching with a wild card description. However, I can explain you the flow in the database:

In DPR_PART, from the participant ID, you can get the role (or particiant) GUID.

From the role GUID, you can find all the shadow roles (each one linked to one BP) in table CGPL_HIERARCHY, with GUID = role GUID. The shadow roles will be in field DOWN.

Then, in DPR_BUPA_LINK, you will find the relashionship between the shadow role and the business partner, with PARTICIPANT_GUID = shadow role. You will find the BP GIUD in field BP_GUID.

Then, in table BUT000, you can find the resource name with key PARTNER_GUID = BP GUID.

For the user ID, you have to go first through the Central Person from the BP, then get the user ID.

Matthias

ramki_maley
Active Contributor
0 Kudos

Matthias,

Thanks very much for the answer. I had two BPs assigned to a Role and following your logic I only get one BP. I did some more analysis and came up with the following.

Get the task GUIDs for the project from CGPL_TASKS.

Get the GUID (key) from DPR_PART where GUID = TASK GUID and Participant_Role = 'ZROLE'.

The GUIDs from CGPL_HEIRARCHY for the Project with UP = DPR_PART-GUID are the BP GUIDs.

I still am interested in knowing how to get this information using BAPIs. BAPI_BUS2172_GET_SUBOBJECTS does get me the BPs but does not tell me which h BP is for which Role (No Technical name for the Role either).

Cheers,

Ramki Maley.