SAP SMON_HARDWARE_OBJECT_VIEWER Function Module for
SMON_HARDWARE_OBJECT_VIEWER is a standard smon hardware object viewer 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 smon hardware object viewer FM, simply by entering the name SMON_HARDWARE_OBJECT_VIEWER into the relevant SAP transaction such as SE37 or SE38.
Function Group: SMON
Program Name: SAPLSMON
Main Program: SAPLSMON
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SMON_HARDWARE_OBJECT_VIEWER 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 'SMON_HARDWARE_OBJECT_VIEWER'".
EXPORTING
* HW_LOGICAL_DESTINATION = ' ' "Logical OS Collector Destination
* HW_LOCALITY = 'LOCAL' "Locality (Local, Internal, Remote)
EXCEPTIONS
NO_HW_OBJECT_DESCR_FOUND = 1 INVALID_HW_OBJECT_DESCR = 2 CANT_READ_HW_OBJECT_DESCR = 3 ERROR_SHOWING_HW_TREE = 4
IMPORTING Parameters details for SMON_HARDWARE_OBJECT_VIEWER
HW_LOGICAL_DESTINATION - Logical OS Collector Destination
Data type: RFCDES-RFCDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HW_LOCALITY - Locality (Local, Internal, Remote)
Data type: DEF_PAR_FU-LOC_REMOTEDefault: 'LOCAL'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_HW_OBJECT_DESCR_FOUND - No hardware object description found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_HW_OBJECT_DESCR - Hardware object description contains a syntax error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CANT_READ_HW_OBJECT_DESCR - Cannot read hardware object description
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_SHOWING_HW_TREE - Error when displaying the hardware tree
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SMON_HARDWARE_OBJECT_VIEWER 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_hw_logical_destination | TYPE RFCDES-RFCDEST, " SPACE | |||
| lv_no_hw_object_descr_found | TYPE RFCDES, " | |||
| lv_hw_locality | TYPE DEF_PAR_FU-LOC_REMOTE, " 'LOCAL' | |||
| lv_invalid_hw_object_descr | TYPE DEF_PAR_FU, " | |||
| lv_cant_read_hw_object_descr | TYPE DEF_PAR_FU, " | |||
| lv_error_showing_hw_tree | TYPE DEF_PAR_FU. " |
|   CALL FUNCTION 'SMON_HARDWARE_OBJECT_VIEWER' " |
| EXPORTING | ||
| HW_LOGICAL_DESTINATION | = lv_hw_logical_destination | |
| HW_LOCALITY | = lv_hw_locality | |
| EXCEPTIONS | ||
| NO_HW_OBJECT_DESCR_FOUND = 1 | ||
| INVALID_HW_OBJECT_DESCR = 2 | ||
| CANT_READ_HW_OBJECT_DESCR = 3 | ||
| ERROR_SHOWING_HW_TREE = 4 | ||
| . " SMON_HARDWARE_OBJECT_VIEWER | ||
ABAP code using 7.40 inline data declarations to call FM SMON_HARDWARE_OBJECT_VIEWER
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 RFCDEST FROM RFCDES INTO @DATA(ld_hw_logical_destination). | ||||
| DATA(ld_hw_logical_destination) | = ' '. | |||
| "SELECT single LOC_REMOTE FROM DEF_PAR_FU INTO @DATA(ld_hw_locality). | ||||
| DATA(ld_hw_locality) | = 'LOCAL'. | |||
Search for further information about these or an SAP related objects