SAP RH_GET_ACTORS Function Module for Resolve Role
RH_GET_ACTORS is a standard rh get actors SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Resolve Role processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for rh get actors FM, simply by entering the name RH_GET_ACTORS into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHWA
Program Name: SAPLRHWA
Main Program:
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_GET_ACTORS pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'RH_GET_ACTORS'"Resolve Role.
EXPORTING
ACT_OBJECT = "Role object (type and ID)
* ACT_TASK = "Task for which role resolution is carried out
* ACT_WI_ID = "
* ACT_PLVAR = "Plan version (default -> active plan version)
* SEARCH_DATE = SY-DATUM "Date for role resolution
* ACTOR_CONTAINER_OO = "Container: Implementing Class
TABLES
* ACTOR_CONTAINER = "Import container for role resolution
* EXCLUDED_AGENTS = "
ACTOR_TAB = "Role resolution result
* ERROR_TAB = "Agents determined with no task
EXCEPTIONS
NO_ACTIVE_PLVAR = 1 NO_ACTOR_FOUND = 2 EXCEPTION_OF_ROLE_RAISED = 3 NO_VALID_AGENT_DETERMINED = 4 NO_CONTAINER = 5
IMPORTING Parameters details for RH_GET_ACTORS
ACT_OBJECT - Role object (type and ID)
Data type: RHOBJECTS-OBJECTOptional: No
Call by Reference: No ( called with pass by value option)
ACT_TASK - Task for which role resolution is carried out
Data type: RHOBJECTS-OBJECTOptional: Yes
Call by Reference: No ( called with pass by value option)
ACT_WI_ID -
Data type: SWWWIHEAD-WI_IDOptional: Yes
Call by Reference: No ( called with pass by value option)
ACT_PLVAR - Plan version (default -> active plan version)
Data type: OBJEC-PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
SEARCH_DATE - Date for role resolution
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ACTOR_CONTAINER_OO - Container: Implementing Class
Data type: IF_SWF_CNT_CONTAINEROptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_GET_ACTORS
ACTOR_CONTAINER - Import container for role resolution
Data type: SWCONTOptional: Yes
Call by Reference: Yes
EXCLUDED_AGENTS -
Data type: SWHACTOROptional: Yes
Call by Reference: No ( called with pass by value option)
ACTOR_TAB - Role resolution result
Data type: SWHACTOROptional: No
Call by Reference: No ( called with pass by value option)
ERROR_TAB - Agents determined with no task
Data type: SWHACTOROptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_ACTIVE_PLVAR - No active plan version found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ACTOR_FOUND - No agent found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTION_OF_ROLE_RAISED - Exception triggered in role function module
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_VALID_AGENT_DETERMINED - Role function module determined no valid agent
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_CONTAINER -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RH_GET_ACTORS Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_act_object | TYPE RHOBJECTS-OBJECT, " | |||
| lt_actor_container | TYPE STANDARD TABLE OF SWCONT, " | |||
| lv_no_active_plvar | TYPE SWCONT, " | |||
| lv_act_task | TYPE RHOBJECTS-OBJECT, " | |||
| lv_no_actor_found | TYPE RHOBJECTS, " | |||
| lt_excluded_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lt_actor_tab | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_act_wi_id | TYPE SWWWIHEAD-WI_ID, " | |||
| lv_exception_of_role_raised | TYPE SWWWIHEAD, " | |||
| lv_act_plvar | TYPE OBJEC-PLVAR, " | |||
| lt_error_tab | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_no_valid_agent_determined | TYPE SWHACTOR, " | |||
| lv_search_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_no_container | TYPE SY, " | |||
| lv_actor_container_oo | TYPE IF_SWF_CNT_CONTAINER. " |
|   CALL FUNCTION 'RH_GET_ACTORS' "Resolve Role |
| EXPORTING | ||
| ACT_OBJECT | = lv_act_object | |
| ACT_TASK | = lv_act_task | |
| ACT_WI_ID | = lv_act_wi_id | |
| ACT_PLVAR | = lv_act_plvar | |
| SEARCH_DATE | = lv_search_date | |
| ACTOR_CONTAINER_OO | = lv_actor_container_oo | |
| TABLES | ||
| ACTOR_CONTAINER | = lt_actor_container | |
| EXCLUDED_AGENTS | = lt_excluded_agents | |
| ACTOR_TAB | = lt_actor_tab | |
| ERROR_TAB | = lt_error_tab | |
| EXCEPTIONS | ||
| NO_ACTIVE_PLVAR = 1 | ||
| NO_ACTOR_FOUND = 2 | ||
| EXCEPTION_OF_ROLE_RAISED = 3 | ||
| NO_VALID_AGENT_DETERMINED = 4 | ||
| NO_CONTAINER = 5 | ||
| . " RH_GET_ACTORS | ||
ABAP code using 7.40 inline data declarations to call FM RH_GET_ACTORS
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single OBJECT FROM RHOBJECTS INTO @DATA(ld_act_object). | ||||
| "SELECT single OBJECT FROM RHOBJECTS INTO @DATA(ld_act_task). | ||||
| "SELECT single WI_ID FROM SWWWIHEAD INTO @DATA(ld_act_wi_id). | ||||
| "SELECT single PLVAR FROM OBJEC INTO @DATA(ld_act_plvar). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_search_date). | ||||
| DATA(ld_search_date) | = SY-DATUM. | |||
Search for further information about these or an SAP related objects