Assign resource to task via abap automatically
I need to assign via abap a resource to a task.
The scenario is the following:
I have a RoleA with 4 resources staffed (Resource1, Resource2, Resource3, Resource4) and 2 tasks assigned (Task1, Task2).
I need to assign for example Resource1 to Task1 via abap knowing:
- Task1 guid
- RoleA guid
- Resource1 business partner guid.
How is it possible?
Is there a function module or a method to do this?