SAP BAPI_PHSRVAPS_GETDETAIL Function Module for Read Product Hierarchy
BAPI_PHSRVAPS_GETDETAIL is a standard bapi phsrvaps getdetail 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 Product Hierarchy 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 bapi phsrvaps getdetail FM, simply by entering the name BAPI_PHSRVAPS_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: 10017
Program Name: SAPL10017
Main Program: SAPL10017
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_PHSRVAPS_GETDETAIL 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 'BAPI_PHSRVAPS_GETDETAIL'"Read Product Hierarchy.
EXPORTING
NAME = "Product Hierarchy Name
LOGICAL_SYSTEM = "Logical System from which Message Originates
* BUSINESS_SYSTEM_GROUP = "Business System Group
IMPORTING
HIERARCHY_INFO = "Header Data for Product Hierarchy
TABLES
* HIERARCHY_NODES = "Hierarchy Node
* RETURN = "Return Parameters
* EXTENSION_IN = "Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
* EXTENSION_OUT = "Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
IMPORTING Parameters details for BAPI_PHSRVAPS_GETDETAIL
NAME - Product Hierarchy Name
Data type: BAPI10017GENFIELDS-PRD_HIERARCHYOptional: No
Call by Reference: No ( called with pass by value option)
LOGICAL_SYSTEM - Logical System from which Message Originates
Data type: BAPISCMBGENFIELDS-LOGICAL_SYSTEMOptional: No
Call by Reference: No ( called with pass by value option)
BUSINESS_SYSTEM_GROUP - Business System Group
Data type: BAPISCMBGENFIELDS-LOGQSOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PHSRVAPS_GETDETAIL
HIERARCHY_INFO - Header Data for Product Hierarchy
Data type: BAPI10017PHOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_PHSRVAPS_GETDETAIL
HIERARCHY_NODES - Hierarchy Node
Data type: BAPI10017PHNODEOOptional: Yes
Call by Reference: Yes
RETURN - Return Parameters
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
EXTENSION_IN - Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
EXTENSION_OUT - Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_PHSRVAPS_GETDETAIL 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_name | TYPE BAPI10017GENFIELDS-PRD_HIERARCHY, " | |||
| lv_hierarchy_info | TYPE BAPI10017PHO, " | |||
| lt_hierarchy_nodes | TYPE STANDARD TABLE OF BAPI10017PHNODEO, " | |||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_logical_system | TYPE BAPISCMBGENFIELDS-LOGICAL_SYSTEM, " | |||
| lt_extension_in | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lv_business_system_group | TYPE BAPISCMBGENFIELDS-LOGQS, " | |||
| lt_extension_out | TYPE STANDARD TABLE OF BAPIPAREX. " |
|   CALL FUNCTION 'BAPI_PHSRVAPS_GETDETAIL' "Read Product Hierarchy |
| EXPORTING | ||
| NAME | = lv_name | |
| LOGICAL_SYSTEM | = lv_logical_system | |
| BUSINESS_SYSTEM_GROUP | = lv_business_system_group | |
| IMPORTING | ||
| HIERARCHY_INFO | = lv_hierarchy_info | |
| TABLES | ||
| HIERARCHY_NODES | = lt_hierarchy_nodes | |
| RETURN | = lt_return | |
| EXTENSION_IN | = lt_extension_in | |
| EXTENSION_OUT | = lt_extension_out | |
| . " BAPI_PHSRVAPS_GETDETAIL | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_PHSRVAPS_GETDETAIL
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 PRD_HIERARCHY FROM BAPI10017GENFIELDS INTO @DATA(ld_name). | ||||
| "SELECT single LOGICAL_SYSTEM FROM BAPISCMBGENFIELDS INTO @DATA(ld_logical_system). | ||||
| "SELECT single LOGQS FROM BAPISCMBGENFIELDS INTO @DATA(ld_business_system_group). | ||||
Search for further information about these or an SAP related objects