SAP RH_AGENT_INFO Function Module for Display Agent Information
RH_AGENT_INFO is a standard rh agent info SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Display Agent Information 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 agent info FM, simply by entering the name RH_AGENT_INFO into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHWG
Program Name: SAPLRHWG
Main Program: SAPLRHWG
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_AGENT_INFO 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_AGENT_INFO'"Display Agent Information.
EXPORTING
AGENT_OTYPE = "
AGENT_OBJID = "
* ACT_PLVAR = "
* SEARCH_DATE = SY-DATUM "
* SEARCH_END = "
* NO_TASK_DISPLAY = 'X' "
* DISPLAY_ONLY = "
EXCEPTIONS
NO_ACTIVE_PLVAR = 1 NO_ENTRY_FOUND = 2 DEFAULT_POSITION = 3
IMPORTING Parameters details for RH_AGENT_INFO
AGENT_OTYPE -
Data type: OBJEC-OTYPEOptional: No
Call by Reference: No ( called with pass by value option)
AGENT_OBJID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACT_PLVAR -
Data type: OBJEC-PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
SEARCH_DATE -
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEARCH_END -
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_TASK_DISPLAY -
Data type: OBJEC-HISTODefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DISPLAY_ONLY -
Data type: OBJEC-HISTOOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_ACTIVE_PLVAR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ENTRY_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DEFAULT_POSITION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_AGENT_INFO 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_agent_otype | TYPE OBJEC-OTYPE, " | |||
| lv_no_active_plvar | TYPE OBJEC, " | |||
| lv_agent_objid | TYPE OBJEC, " | |||
| lv_no_entry_found | TYPE OBJEC, " | |||
| lv_act_plvar | TYPE OBJEC-PLVAR, " | |||
| lv_default_position | TYPE OBJEC, " | |||
| lv_search_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_search_end | TYPE SY-DATUM, " | |||
| lv_no_task_display | TYPE OBJEC-HISTO, " 'X' | |||
| lv_display_only | TYPE OBJEC-HISTO. " |
|   CALL FUNCTION 'RH_AGENT_INFO' "Display Agent Information |
| EXPORTING | ||
| AGENT_OTYPE | = lv_agent_otype | |
| AGENT_OBJID | = lv_agent_objid | |
| ACT_PLVAR | = lv_act_plvar | |
| SEARCH_DATE | = lv_search_date | |
| SEARCH_END | = lv_search_end | |
| NO_TASK_DISPLAY | = lv_no_task_display | |
| DISPLAY_ONLY | = lv_display_only | |
| EXCEPTIONS | ||
| NO_ACTIVE_PLVAR = 1 | ||
| NO_ENTRY_FOUND = 2 | ||
| DEFAULT_POSITION = 3 | ||
| . " RH_AGENT_INFO | ||
ABAP code using 7.40 inline data declarations to call FM RH_AGENT_INFO
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 OTYPE FROM OBJEC INTO @DATA(ld_agent_otype). | ||||
| "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. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_search_end). | ||||
| "SELECT single HISTO FROM OBJEC INTO @DATA(ld_no_task_display). | ||||
| DATA(ld_no_task_display) | = 'X'. | |||
| "SELECT single HISTO FROM OBJEC INTO @DATA(ld_display_only). | ||||
Search for further information about these or an SAP related objects