SAP HRHAPCN_OBJ_LIB_READ Function Module for Read Objective Library Tree
HRHAPCN_OBJ_LIB_READ is a standard hrhapcn obj lib read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Objective Library Tree 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 hrhapcn obj lib read FM, simply by entering the name HRHAPCN_OBJ_LIB_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRHAPCN_PA_UI_OBJLIB
Program Name: SAPLHRHAPCN_PA_UI_OBJLIB
Main Program: SAPLHRHAPCN_PA_UI_OBJLIB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function HRHAPCN_OBJ_LIB_READ 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 'HRHAPCN_OBJ_LIB_READ'"Read Objective Library Tree.
EXPORTING
* PLVAR = "Plan Version
* BEGDA = SY-DATUM "Start Date
* ENDDA = SY-DATUM "End Date
* ALL_OR_BASE = 'B' "Internal ABAP System Field
* PUP_INFO = 'X' "Internal ABAP System Field
* UPDATE_INDEX = 'X' "Internal ABAP System Field
* DEPTH = 0 "Display Depth of Structure
* SORT = 'X' "Internal ABAP System Field
* SVECT = '1 ' "Status Vector
IMPORTING
O_TAB = "Objective Library Table
O_WITHOUT_CLASS = "Objective Library Table
EXCEPTIONS
ROOT_NOT_FOUND = 1 WEGID_NOT_VALID = 2
IMPORTING Parameters details for HRHAPCN_OBJ_LIB_READ
PLVAR - Plan Version
Data type: PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
BEGDA - Start Date
Data type: BEGDATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENDDA - End Date
Data type: ENDDATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ALL_OR_BASE - Internal ABAP System Field
Data type: SYINPUTDefault: 'B'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PUP_INFO - Internal ABAP System Field
Data type: SYINPUTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPDATE_INDEX - Internal ABAP System Field
Data type: SYINPUTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEPTH - Display Depth of Structure
Data type: DEPTHOptional: Yes
Call by Reference: No ( called with pass by value option)
SORT - Internal ABAP System Field
Data type: SYINPUTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SVECT - Status Vector
Data type: GDSTR-SVECTDefault: '1 '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for HRHAPCN_OBJ_LIB_READ
O_TAB - Objective Library Table
Data type: HAPCN_T_OBJ_LIBOptional: No
Call by Reference: No ( called with pass by value option)
O_WITHOUT_CLASS - Objective Library Table
Data type: HAPCN_T_OBJ_LIBOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ROOT_NOT_FOUND - Root object not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WEGID_NOT_VALID - Evaluation path not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for HRHAPCN_OBJ_LIB_READ 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_o_tab | TYPE HAPCN_T_OBJ_LIB, " | |||
| lv_plvar | TYPE PLVAR, " | |||
| lv_root_not_found | TYPE PLVAR, " | |||
| lv_begda | TYPE BEGDATUM, " SY-DATUM | |||
| lv_o_without_class | TYPE HAPCN_T_OBJ_LIB, " | |||
| lv_wegid_not_valid | TYPE HAPCN_T_OBJ_LIB, " | |||
| lv_endda | TYPE ENDDATUM, " SY-DATUM | |||
| lv_all_or_base | TYPE SYINPUT, " 'B' | |||
| lv_pup_info | TYPE SYINPUT, " 'X' | |||
| lv_update_index | TYPE SYINPUT, " 'X' | |||
| lv_depth | TYPE DEPTH, " 0 | |||
| lv_sort | TYPE SYINPUT, " 'X' | |||
| lv_svect | TYPE GDSTR-SVECT. " '1 ' |
|   CALL FUNCTION 'HRHAPCN_OBJ_LIB_READ' "Read Objective Library Tree |
| EXPORTING | ||
| PLVAR | = lv_plvar | |
| BEGDA | = lv_begda | |
| ENDDA | = lv_endda | |
| ALL_OR_BASE | = lv_all_or_base | |
| PUP_INFO | = lv_pup_info | |
| UPDATE_INDEX | = lv_update_index | |
| DEPTH | = lv_depth | |
| SORT | = lv_sort | |
| SVECT | = lv_svect | |
| IMPORTING | ||
| O_TAB | = lv_o_tab | |
| O_WITHOUT_CLASS | = lv_o_without_class | |
| EXCEPTIONS | ||
| ROOT_NOT_FOUND = 1 | ||
| WEGID_NOT_VALID = 2 | ||
| . " HRHAPCN_OBJ_LIB_READ | ||
ABAP code using 7.40 inline data declarations to call FM HRHAPCN_OBJ_LIB_READ
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.| DATA(ld_begda) | = SY-DATUM. | |||
| DATA(ld_endda) | = SY-DATUM. | |||
| DATA(ld_all_or_base) | = 'B'. | |||
| DATA(ld_pup_info) | = 'X'. | |||
| DATA(ld_update_index) | = 'X'. | |||
| DATA(ld_sort) | = 'X'. | |||
| "SELECT single SVECT FROM GDSTR INTO @DATA(ld_svect). | ||||
| DATA(ld_svect) | = '1 '. | |||
Search for further information about these or an SAP related objects