cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy assigned roles from Task B to Task B

Former Member
0 Kudos

Hello,

I have a task A (CL_DPR_TASK_O), where some roles are assigned and I have to copy all of the assigned roles to Task B (also C_DPR_TASK_O)

I already found out, that the roles are in task A->MR_PARTICIPANT_LINKS->GET_PARTICIPANTS( ) but I have no idea how to copy them to Task B.

Hopefully someone can help me...

Accepted Solutions (0)

Answers (1)

Answers (1)

priyatham_kasu2
Active Participant
0 Kudos

Hi Rene,

If you want to copy the roles of TASK A to TASK B and if both the tasks are already created then you have to write your own enhancement.

If you want to copy TASK A (already existing) and create TASK B with resource assignments then you can include your logic in the BADI DPR_ATTRIBUTES method SET_DEFAULTS_UPON_COPYING.

Once you have the Role GUIDS from TASK A then assign them to TASK B using

cl_dpr_participant -> mr_entity_links->add.

Pass the new task reference to the importing parameter  ir_entity.

If you plan on using the BADI approach make sure you have validations for the origin type as this method will be called even during creation of the Project with template and will result in short dump.

Best Regards,

Priyatham