SAP UPG_READ_SYS_ENVIRONMENT Function Module for Liest die für den Upgrade relevanten Umgebungsvariablen des Systems
UPG_READ_SYS_ENVIRONMENT is a standard upg read sys environment SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Liest die für den Upgrade relevanten Umgebungsvariablen des Systems 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 upg read sys environment FM, simply by entering the name UPG_READ_SYS_ENVIRONMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SUGG
Program Name: SAPLSUGG
Main Program: SAPLSUGG
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function UPG_READ_SYS_ENVIRONMENT 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 'UPG_READ_SYS_ENVIRONMENT'"Liest die für den Upgrade relevanten Umgebungsvariablen des Systems.
EXPORTING
IV_SERVER = "R/3 Applikationssserver (host_sys_nr)
IMPORTING
EV_HOST = "Hostname für den Messageserver
EV_CURBANAME = "Momentane Betriebsart
EV_USERNO = "Anzahl angemeldete Benutzer
EV_ALSTATE = "Globaler Status der Alerts
EV_FUNCRC = "Return Code des ADM-Bausteins
EV_ADMRC = "Return Code des ADM-Calls
EV_ADDONSTATE = "Globaler Ausgangsstatus der Add-Ons
EV_KRN_COMPON = "Zeile mit 80 Zeichen
EV_SAPSYSTEMID = "rfc : SAP-Maschinenkennung
EV_SYSNAME = "Name des ganzen Systems
EV_SYSNR = "Nummer des Applikationsservers
EV_HOMEDIR = "Arbeitsverzeichnis des Applikationsservers
EV_PFSTART = "Start-Profil (voller Pfad)
EV_PFINST = "Instanz-Profil (voller Pfad)
EV_SERVICES = "angebotenen Services (DVEBMGS)
EV_WPNODIA = "Anzahl Dialogprozesse
EV_WPNOBTC = "Anzahl Batchprozesse
EXCEPTIONS
SERVER_NOT_AVAILABLE = 1 NO_ADM_MESSAGE = 2
IMPORTING Parameters details for UPG_READ_SYS_ENVIRONMENT
IV_SERVER - R/3 Applikationssserver (host_sys_nr)
Data type: SPFIS-APSERVEROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for UPG_READ_SYS_ENVIRONMENT
EV_HOST - Hostname für den Messageserver
Data type: SPFIS-HOSTOptional: No
Call by Reference: No ( called with pass by value option)
EV_CURBANAME - Momentane Betriebsart
Data type: SPFIS-CURBANAMEOptional: No
Call by Reference: No ( called with pass by value option)
EV_USERNO - Anzahl angemeldete Benutzer
Data type: SPFIS-USERNOOptional: No
Call by Reference: No ( called with pass by value option)
EV_ALSTATE - Globaler Status der Alerts
Data type: SPFIS-STATEOptional: No
Call by Reference: No ( called with pass by value option)
EV_FUNCRC - Return Code des ADM-Bausteins
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
EV_ADMRC - Return Code des ADM-Calls
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
EV_ADDONSTATE - Globaler Ausgangsstatus der Add-Ons
Data type: AVERS-UPDSTATUSOptional: No
Call by Reference: No ( called with pass by value option)
EV_KRN_COMPON - Zeile mit 80 Zeichen
Data type: CHAR80Optional: No
Call by Reference: No ( called with pass by value option)
EV_SAPSYSTEMID - rfc : SAP-Maschinenkennung
Data type: RFCMACHOptional: No
Call by Reference: No ( called with pass by value option)
EV_SYSNAME - Name des ganzen Systems
Data type: SPFIS-SYSNAMEOptional: No
Call by Reference: No ( called with pass by value option)
EV_SYSNR - Nummer des Applikationsservers
Data type: SPFIS-SYSNROptional: No
Call by Reference: No ( called with pass by value option)
EV_HOMEDIR - Arbeitsverzeichnis des Applikationsservers
Data type: SPFIS-HOMEDIROptional: No
Call by Reference: No ( called with pass by value option)
EV_PFSTART - Start-Profil (voller Pfad)
Data type: SPFIS-PFSTARTOptional: No
Call by Reference: No ( called with pass by value option)
EV_PFINST - Instanz-Profil (voller Pfad)
Data type: SPFIS-PFINSTOptional: No
Call by Reference: No ( called with pass by value option)
EV_SERVICES - angebotenen Services (DVEBMGS)
Data type: SPFIS-CMPONAPSOptional: No
Call by Reference: No ( called with pass by value option)
EV_WPNODIA - Anzahl Dialogprozesse
Data type: SPFIS-WPNODIAOptional: No
Call by Reference: No ( called with pass by value option)
EV_WPNOBTC - Anzahl Batchprozesse
Data type: SPFIS-WPNOBTCOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
SERVER_NOT_AVAILABLE - Der Server ist dem Messageserver nicht bekannt
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ADM_MESSAGE - Der Messageserver ist nicht erreichbar
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for UPG_READ_SYS_ENVIRONMENT 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_ev_host | TYPE SPFIS-HOST, " | |||
| lv_iv_server | TYPE SPFIS-APSERVER, " | |||
| lv_server_not_available | TYPE SPFIS, " | |||
| lv_ev_curbaname | TYPE SPFIS-CURBANAME, " | |||
| lv_ev_userno | TYPE SPFIS-USERNO, " | |||
| lv_ev_alstate | TYPE SPFIS-STATE, " | |||
| lv_ev_funcrc | TYPE SY-SUBRC, " | |||
| lv_ev_admrc | TYPE SY-SUBRC, " | |||
| lv_ev_addonstate | TYPE AVERS-UPDSTATUS, " | |||
| lv_ev_krn_compon | TYPE CHAR80, " | |||
| lv_ev_sapsystemid | TYPE RFCMACH, " | |||
| lv_ev_sysname | TYPE SPFIS-SYSNAME, " | |||
| lv_no_adm_message | TYPE SPFIS, " | |||
| lv_ev_sysnr | TYPE SPFIS-SYSNR, " | |||
| lv_ev_homedir | TYPE SPFIS-HOMEDIR, " | |||
| lv_ev_pfstart | TYPE SPFIS-PFSTART, " | |||
| lv_ev_pfinst | TYPE SPFIS-PFINST, " | |||
| lv_ev_services | TYPE SPFIS-CMPONAPS, " | |||
| lv_ev_wpnodia | TYPE SPFIS-WPNODIA, " | |||
| lv_ev_wpnobtc | TYPE SPFIS-WPNOBTC. " |
|   CALL FUNCTION 'UPG_READ_SYS_ENVIRONMENT' "Liest die für den Upgrade relevanten Umgebungsvariablen des Systems |
| EXPORTING | ||
| IV_SERVER | = lv_iv_server | |
| IMPORTING | ||
| EV_HOST | = lv_ev_host | |
| EV_CURBANAME | = lv_ev_curbaname | |
| EV_USERNO | = lv_ev_userno | |
| EV_ALSTATE | = lv_ev_alstate | |
| EV_FUNCRC | = lv_ev_funcrc | |
| EV_ADMRC | = lv_ev_admrc | |
| EV_ADDONSTATE | = lv_ev_addonstate | |
| EV_KRN_COMPON | = lv_ev_krn_compon | |
| EV_SAPSYSTEMID | = lv_ev_sapsystemid | |
| EV_SYSNAME | = lv_ev_sysname | |
| EV_SYSNR | = lv_ev_sysnr | |
| EV_HOMEDIR | = lv_ev_homedir | |
| EV_PFSTART | = lv_ev_pfstart | |
| EV_PFINST | = lv_ev_pfinst | |
| EV_SERVICES | = lv_ev_services | |
| EV_WPNODIA | = lv_ev_wpnodia | |
| EV_WPNOBTC | = lv_ev_wpnobtc | |
| EXCEPTIONS | ||
| SERVER_NOT_AVAILABLE = 1 | ||
| NO_ADM_MESSAGE = 2 | ||
| . " UPG_READ_SYS_ENVIRONMENT | ||
ABAP code using 7.40 inline data declarations to call FM UPG_READ_SYS_ENVIRONMENT
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 HOST FROM SPFIS INTO @DATA(ld_ev_host). | ||||
| "SELECT single APSERVER FROM SPFIS INTO @DATA(ld_iv_server). | ||||
| "SELECT single CURBANAME FROM SPFIS INTO @DATA(ld_ev_curbaname). | ||||
| "SELECT single USERNO FROM SPFIS INTO @DATA(ld_ev_userno). | ||||
| "SELECT single STATE FROM SPFIS INTO @DATA(ld_ev_alstate). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_ev_funcrc). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_ev_admrc). | ||||
| "SELECT single UPDSTATUS FROM AVERS INTO @DATA(ld_ev_addonstate). | ||||
| "SELECT single SYSNAME FROM SPFIS INTO @DATA(ld_ev_sysname). | ||||
| "SELECT single SYSNR FROM SPFIS INTO @DATA(ld_ev_sysnr). | ||||
| "SELECT single HOMEDIR FROM SPFIS INTO @DATA(ld_ev_homedir). | ||||
| "SELECT single PFSTART FROM SPFIS INTO @DATA(ld_ev_pfstart). | ||||
| "SELECT single PFINST FROM SPFIS INTO @DATA(ld_ev_pfinst). | ||||
| "SELECT single CMPONAPS FROM SPFIS INTO @DATA(ld_ev_services). | ||||
| "SELECT single WPNODIA FROM SPFIS INTO @DATA(ld_ev_wpnodia). | ||||
| "SELECT single WPNOBTC FROM SPFIS INTO @DATA(ld_ev_wpnobtc). | ||||
Search for further information about these or an SAP related objects