SAP RH_GET_WFD_ID Function Module for Determine Workflow Definition of Task (and Org. Unit) Specified
RH_GET_WFD_ID is a standard rh get wfd id SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine Workflow Definition of Task (and Org. Unit) Specified 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 wfd id FM, simply by entering the name RH_GET_WFD_ID 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): Remote-Enabled
Update:

Function RH_GET_WFD_ID 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_WFD_ID'"Determine Workflow Definition of Task (and Org. Unit) Specified.
EXPORTING
ACT_TASK = "Role object (type and ID)
* SEARCH_DATE = SY-DATUM "Date for role resolution
* ACT_ORG_UNIT = "Role object (type and ID)
* ACT_PLVAR = "Plan version
IMPORTING
ACT_WFD_ID = "
ACT_VERSION = "
ACT_ACTIVE = "
ACT_ACTIV_DATE = "
ACT_ACTIV_TIME = "
SAPRL = "
EXCEPTIONS
NO_ACTIVE_PLVAR = 1 NO_WFD_ID_FOUND = 2 ORG_UNIT_NOT_VALID = 3 TASK_NOT_VALID = 4 ACTIVATION_NOT_POSSIBLE = 5
IMPORTING Parameters details for RH_GET_WFD_ID
ACT_TASK - Role object (type and ID)
Data type: RHOBJECTS-OBJECTOptional: No
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)
ACT_ORG_UNIT - Role object (type and ID)
Data type: RHOBJECTS-OBJECTOptional: Yes
Call by Reference: No ( called with pass by value option)
ACT_PLVAR - Plan version
Data type: PLOG-PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RH_GET_WFD_ID
ACT_WFD_ID -
Data type: P1205-WFD_IDOptional: No
Call by Reference: No ( called with pass by value option)
ACT_VERSION -
Data type: P1205-VERSIONOptional: No
Call by Reference: No ( called with pass by value option)
ACT_ACTIVE -
Data type: P1205-ACTIVEOptional: No
Call by Reference: No ( called with pass by value option)
ACT_ACTIV_DATE -
Data type: P1205-ACTIV_DATEOptional: No
Call by Reference: No ( called with pass by value option)
ACT_ACTIV_TIME -
Data type: P1205-ACTIV_TIMEOptional: No
Call by Reference: No ( called with pass by value option)
SAPRL -
Data type: P1205-SAPRLOptional: No
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_WFD_ID_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ORG_UNIT_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TASK_NOT_VALID - No agent found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTIVATION_NOT_POSSIBLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_GET_WFD_ID 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_task | TYPE RHOBJECTS-OBJECT, " | |||
| lv_act_wfd_id | TYPE P1205-WFD_ID, " | |||
| lv_no_active_plvar | TYPE P1205, " | |||
| lv_act_version | TYPE P1205-VERSION, " | |||
| lv_search_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_no_wfd_id_found | TYPE SY, " | |||
| lv_act_active | TYPE P1205-ACTIVE, " | |||
| lv_act_org_unit | TYPE RHOBJECTS-OBJECT, " | |||
| lv_org_unit_not_valid | TYPE RHOBJECTS, " | |||
| lv_act_plvar | TYPE PLOG-PLVAR, " | |||
| lv_act_activ_date | TYPE P1205-ACTIV_DATE, " | |||
| lv_task_not_valid | TYPE P1205, " | |||
| lv_act_activ_time | TYPE P1205-ACTIV_TIME, " | |||
| lv_activation_not_possible | TYPE P1205, " | |||
| lv_saprl | TYPE P1205-SAPRL. " |
|   CALL FUNCTION 'RH_GET_WFD_ID' "Determine Workflow Definition of Task (and Org. Unit) Specified |
| EXPORTING | ||
| ACT_TASK | = lv_act_task | |
| SEARCH_DATE | = lv_search_date | |
| ACT_ORG_UNIT | = lv_act_org_unit | |
| ACT_PLVAR | = lv_act_plvar | |
| IMPORTING | ||
| ACT_WFD_ID | = lv_act_wfd_id | |
| ACT_VERSION | = lv_act_version | |
| ACT_ACTIVE | = lv_act_active | |
| ACT_ACTIV_DATE | = lv_act_activ_date | |
| ACT_ACTIV_TIME | = lv_act_activ_time | |
| SAPRL | = lv_saprl | |
| EXCEPTIONS | ||
| NO_ACTIVE_PLVAR = 1 | ||
| NO_WFD_ID_FOUND = 2 | ||
| ORG_UNIT_NOT_VALID = 3 | ||
| TASK_NOT_VALID = 4 | ||
| ACTIVATION_NOT_POSSIBLE = 5 | ||
| . " RH_GET_WFD_ID | ||
ABAP code using 7.40 inline data declarations to call FM RH_GET_WFD_ID
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_task). | ||||
| "SELECT single WFD_ID FROM P1205 INTO @DATA(ld_act_wfd_id). | ||||
| "SELECT single VERSION FROM P1205 INTO @DATA(ld_act_version). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_search_date). | ||||
| DATA(ld_search_date) | = SY-DATUM. | |||
| "SELECT single ACTIVE FROM P1205 INTO @DATA(ld_act_active). | ||||
| "SELECT single OBJECT FROM RHOBJECTS INTO @DATA(ld_act_org_unit). | ||||
| "SELECT single PLVAR FROM PLOG INTO @DATA(ld_act_plvar). | ||||
| "SELECT single ACTIV_DATE FROM P1205 INTO @DATA(ld_act_activ_date). | ||||
| "SELECT single ACTIV_TIME FROM P1205 INTO @DATA(ld_act_activ_time). | ||||
| "SELECT single SAPRL FROM P1205 INTO @DATA(ld_saprl). | ||||
Search for further information about these or an SAP related objects