SAP TH_SERVER_LIST Function Module for Get Server List









TH_SERVER_LIST is a standard th server list SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Get Server List 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 th server list FM, simply by entering the name TH_SERVER_LIST into the relevant SAP transaction such as SE37 or SE38.

Function Group: THFB
Program Name: SAPLTHFB
Main Program: SAPLTHFB
Appliation area: S
Release date: 16-Jun-1993
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function TH_SERVER_LIST 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 'TH_SERVER_LIST'"Get Server List
EXPORTING
* SERVICES = 255 "BIT Vector of the Services (see Notes)
* SYSSERVICE = 0 "Services of Application Server
* ACTIVE_SERVER = 1 "Display Active Servers Only
* SUBSYSTEM_AWARE = 1 "When systems are separated, only servers from your own subsystem are displayed

TABLES
* LIST = "
* LIST_IPV6 = "Internal Table for Storing the List

EXCEPTIONS
NO_SERVER_LIST = 1
.



IMPORTING Parameters details for TH_SERVER_LIST

SERVICES - BIT Vector of the Services (see Notes)

Data type: MSXXLIST-MSGTYPES
Default: 255
Optional: Yes
Call by Reference: No ( called with pass by value option)

SYSSERVICE - Services of Application Server

Data type: MSSYSSERVICE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ACTIVE_SERVER - Display Active Servers Only

Data type: I
Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)

SUBSYSTEM_AWARE - When systems are separated, only servers from your own subsystem are displayed

Data type: I
Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for TH_SERVER_LIST

LIST -

Data type: MSXXLIST
Optional: Yes
Call by Reference: Yes

LIST_IPV6 - Internal Table for Storing the List

Data type: MSXXLIST_V6
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

NO_SERVER_LIST - No list of servers received

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for TH_SERVER_LIST 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:
lt_list  TYPE STANDARD TABLE OF MSXXLIST, "   
lv_services  TYPE MSXXLIST-MSGTYPES, "   255
lv_no_server_list  TYPE MSXXLIST, "   
lt_list_ipv6  TYPE STANDARD TABLE OF MSXXLIST_V6, "   
lv_sysservice  TYPE MSSYSSERVICE, "   0
lv_active_server  TYPE I, "   1
lv_subsystem_aware  TYPE I. "   1

  CALL FUNCTION 'TH_SERVER_LIST'  "Get Server List
    EXPORTING
         SERVICES = lv_services
         SYSSERVICE = lv_sysservice
         ACTIVE_SERVER = lv_active_server
         SUBSYSTEM_AWARE = lv_subsystem_aware
    TABLES
         LIST = lt_list
         LIST_IPV6 = lt_list_ipv6
    EXCEPTIONS
        NO_SERVER_LIST = 1
. " TH_SERVER_LIST




ABAP code using 7.40 inline data declarations to call FM TH_SERVER_LIST

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 MSGTYPES FROM MSXXLIST INTO @DATA(ld_services).
DATA(ld_services) = 255.
 
 
 
 
DATA(ld_active_server) = 1.
 
DATA(ld_subsystem_aware) = 1.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!