SAP CNPB_H_PROJ_HIER_SELECT Function Module for NOTRANSL: Selektion der Objekte für den Aufbau der Projekthierarchie
CNPB_H_PROJ_HIER_SELECT is a standard cnpb h proj hier select SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Selektion der Objekte für den Aufbau der Projekthierarchie 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 cnpb h proj hier select FM, simply by entering the name CNPB_H_PROJ_HIER_SELECT into the relevant SAP transaction such as SE37 or SE38.
Function Group: CNPB_H
Program Name: SAPLCNPB_H
Main Program: SAPLCNPB_H
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CNPB_H_PROJ_HIER_SELECT 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 'CNPB_H_PROJ_HIER_SELECT'"NOTRANSL: Selektion der Objekte für den Aufbau der Projekthierarchie.
EXPORTING
I_OBJECTS_IN_HIERARCHY = "
* I_RESET = ' ' "
* I_VSNMR = "Number or description of a version
* I_PSPID = "Project Definition
* I_POSID = "WBS Element
* I_AUFNR = "Network Number
* I_FLG_ENQUEUE = 'X' "
* I_EXPAND_LEVELS = '02' "Expanded hierarchy levels
I_DRAG_DROP_HANDLE = "
* I_HIER_COL_IS_KEY = ' ' "
IMPORTING
ET_TREEITM = "
ET_TREEV_NODE = "
E_FLG_ENQUEUE = "
E_OBJECTS_IN_HIERARCHY = "
EXCEPTIONS
NO_IMPORT_PARAMETERS = 1 MORE_THAN_ONE_IMPORT_PARAMETER = 2 NO_OBJECTS_FOUND = 3 NO_AUTHORITY = 4
IMPORTING Parameters details for CNPB_H_PROJ_HIER_SELECT
I_OBJECTS_IN_HIERARCHY -
Data type: CNPB_H_OBJECTS_IN_HIERARCHYOptional: No
Call by Reference: No ( called with pass by value option)
I_RESET -
Data type: CHAR1Default: SPACE
Optional: Yes
Call by Reference: Yes
I_VSNMR - Number or description of a version
Data type: VSKOPF-VSNMROptional: Yes
Call by Reference: No ( called with pass by value option)
I_PSPID - Project Definition
Data type: PROJ-PSPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_POSID - WBS Element
Data type: PRPS-POSIDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AUFNR - Network Number
Data type: AUFK-AUFNROptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_ENQUEUE -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_EXPAND_LEVELS - Expanded hierarchy levels
Data type: CNPB_EXPANDLEVELDefault: '02'
Optional: Yes
Call by Reference: Yes
I_DRAG_DROP_HANDLE -
Data type: CNPB_H_DRAG_DROP_HANDLEOptional: No
Call by Reference: Yes
I_HIER_COL_IS_KEY -
Data type: CDefault: SPACE
Optional: No
Call by Reference: Yes
EXPORTING Parameters details for CNPB_H_PROJ_HIER_SELECT
ET_TREEITM -
Data type: CNPB_H_T_TREEITMOptional: No
Call by Reference: Yes
ET_TREEV_NODE -
Data type: CNPB_H_T_TREEV_NODEOptional: No
Call by Reference: Yes
E_FLG_ENQUEUE -
Data type: COptional: No
Call by Reference: Yes
E_OBJECTS_IN_HIERARCHY -
Data type: CNPB_H_OBJECTS_IN_HIERARCHYOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_IMPORT_PARAMETERS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MORE_THAN_ONE_IMPORT_PARAMETER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_OBJECTS_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CNPB_H_PROJ_HIER_SELECT 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_et_treeitm | TYPE CNPB_H_T_TREEITM, " | |||
| lv_no_import_parameters | TYPE CNPB_H_T_TREEITM, " | |||
| lv_i_objects_in_hierarchy | TYPE CNPB_H_OBJECTS_IN_HIERARCHY, " | |||
| lv_i_reset | TYPE CHAR1, " SPACE | |||
| lv_i_vsnmr | TYPE VSKOPF-VSNMR, " | |||
| lv_et_treev_node | TYPE CNPB_H_T_TREEV_NODE, " | |||
| lv_more_than_one_import_parameter | TYPE CNPB_H_T_TREEV_NODE, " | |||
| lv_i_pspid | TYPE PROJ-PSPID, " | |||
| lv_e_flg_enqueue | TYPE C, " | |||
| lv_no_objects_found | TYPE C, " | |||
| lv_i_posid | TYPE PRPS-POSID, " | |||
| lv_no_authority | TYPE PRPS, " | |||
| lv_e_objects_in_hierarchy | TYPE CNPB_H_OBJECTS_IN_HIERARCHY, " | |||
| lv_i_aufnr | TYPE AUFK-AUFNR, " | |||
| lv_i_flg_enqueue | TYPE C, " 'X' | |||
| lv_i_expand_levels | TYPE CNPB_EXPANDLEVEL, " '02' | |||
| lv_i_drag_drop_handle | TYPE CNPB_H_DRAG_DROP_HANDLE, " | |||
| lv_i_hier_col_is_key | TYPE C. " SPACE |
|   CALL FUNCTION 'CNPB_H_PROJ_HIER_SELECT' "NOTRANSL: Selektion der Objekte für den Aufbau der Projekthierarchie |
| EXPORTING | ||
| I_OBJECTS_IN_HIERARCHY | = lv_i_objects_in_hierarchy | |
| I_RESET | = lv_i_reset | |
| I_VSNMR | = lv_i_vsnmr | |
| I_PSPID | = lv_i_pspid | |
| I_POSID | = lv_i_posid | |
| I_AUFNR | = lv_i_aufnr | |
| I_FLG_ENQUEUE | = lv_i_flg_enqueue | |
| I_EXPAND_LEVELS | = lv_i_expand_levels | |
| I_DRAG_DROP_HANDLE | = lv_i_drag_drop_handle | |
| I_HIER_COL_IS_KEY | = lv_i_hier_col_is_key | |
| IMPORTING | ||
| ET_TREEITM | = lv_et_treeitm | |
| ET_TREEV_NODE | = lv_et_treev_node | |
| E_FLG_ENQUEUE | = lv_e_flg_enqueue | |
| E_OBJECTS_IN_HIERARCHY | = lv_e_objects_in_hierarchy | |
| EXCEPTIONS | ||
| NO_IMPORT_PARAMETERS = 1 | ||
| MORE_THAN_ONE_IMPORT_PARAMETER = 2 | ||
| NO_OBJECTS_FOUND = 3 | ||
| NO_AUTHORITY = 4 | ||
| . " CNPB_H_PROJ_HIER_SELECT | ||
ABAP code using 7.40 inline data declarations to call FM CNPB_H_PROJ_HIER_SELECT
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_i_reset) | = ' '. | |||
| "SELECT single VSNMR FROM VSKOPF INTO @DATA(ld_i_vsnmr). | ||||
| "SELECT single PSPID FROM PROJ INTO @DATA(ld_i_pspid). | ||||
| "SELECT single POSID FROM PRPS INTO @DATA(ld_i_posid). | ||||
| "SELECT single AUFNR FROM AUFK INTO @DATA(ld_i_aufnr). | ||||
| DATA(ld_i_flg_enqueue) | = 'X'. | |||
| DATA(ld_i_expand_levels) | = '02'. | |||
| DATA(ld_i_hier_col_is_key) | = ' '. | |||
Search for further information about these or an SAP related objects