SAP RH_GET_LEADING_POSITION Function Module for
RH_GET_LEADING_POSITION is a standard rh get leading position SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 leading position FM, simply by entering the name RH_GET_LEADING_POSITION into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHWO
Program Name: SAPLRHWO
Main Program: SAPLRHWO
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_GET_LEADING_POSITION 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_LEADING_POSITION'".
EXPORTING
PLVAR = "
OTYPE = "
SOBID = "
* DATE = SY-DATUM "
* AUTH = 'X' "
* BUFFER_MODE = ' ' "
* CONSIDER_VAC_POS = ' ' "General Flag
TABLES
LEADING_POS = "
EXCEPTIONS
NO_LEAD_POS_FOUND = 1
IMPORTING Parameters details for RH_GET_LEADING_POSITION
PLVAR -
Data type: HRSOBID-PLVAROptional: No
Call by Reference: No ( called with pass by value option)
OTYPE -
Data type: HRSOBID-OTYPEOptional: No
Call by Reference: No ( called with pass by value option)
SOBID -
Data type: HRSOBID-SOBIDOptional: No
Call by Reference: No ( called with pass by value option)
DATE -
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
AUTH -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
BUFFER_MODE -
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONSIDER_VAC_POS - General Flag
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_GET_LEADING_POSITION
LEADING_POS -
Data type: HROBJECTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_LEAD_POS_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_GET_LEADING_POSITION 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_plvar | TYPE HRSOBID-PLVAR, " | |||
| lt_leading_pos | TYPE STANDARD TABLE OF HROBJECT, " | |||
| lv_no_lead_pos_found | TYPE HROBJECT, " | |||
| lv_otype | TYPE HRSOBID-OTYPE, " | |||
| lv_sobid | TYPE HRSOBID-SOBID, " | |||
| lv_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_auth | TYPE SY, " 'X' | |||
| lv_buffer_mode | TYPE FLAG, " SPACE | |||
| lv_consider_vac_pos | TYPE XFLAG. " SPACE |
|   CALL FUNCTION 'RH_GET_LEADING_POSITION' " |
| EXPORTING | ||
| PLVAR | = lv_plvar | |
| OTYPE | = lv_otype | |
| SOBID | = lv_sobid | |
| DATE | = lv_date | |
| AUTH | = lv_auth | |
| BUFFER_MODE | = lv_buffer_mode | |
| CONSIDER_VAC_POS | = lv_consider_vac_pos | |
| TABLES | ||
| LEADING_POS | = lt_leading_pos | |
| EXCEPTIONS | ||
| NO_LEAD_POS_FOUND = 1 | ||
| . " RH_GET_LEADING_POSITION | ||
ABAP code using 7.40 inline data declarations to call FM RH_GET_LEADING_POSITION
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 PLVAR FROM HRSOBID INTO @DATA(ld_plvar). | ||||
| "SELECT single OTYPE FROM HRSOBID INTO @DATA(ld_otype). | ||||
| "SELECT single SOBID FROM HRSOBID INTO @DATA(ld_sobid). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_date). | ||||
| DATA(ld_date) | = SY-DATUM. | |||
| DATA(ld_auth) | = 'X'. | |||
| DATA(ld_buffer_mode) | = ' '. | |||
| DATA(ld_consider_vac_pos) | = ' '. | |||
Search for further information about these or an SAP related objects