SAP GET_DB_ORA_SEGSTAT Function Module for V$SEGSTAT monitoring









GET_DB_ORA_SEGSTAT is a standard get db ora segstat SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for V$SEGSTAT monitoring 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 get db ora segstat FM, simply by entering the name GET_DB_ORA_SEGSTAT into the relevant SAP transaction such as SE37 or SE38.

Function Group: STD9
Program Name: SAPLSTD9
Main Program: SAPLSTD9
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function GET_DB_ORA_SEGSTAT 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 'GET_DB_ORA_SEGSTAT'"V$SEGSTAT monitoring
EXPORTING
* N_ROWS = 50 "Natural number
* PROCESS = 'D' "Single-character flag
* INST_ID = ' ' "Not More Closely Defined Area, Possibly Used for Patchlevels
* TAB_NB = '1' "Single-character flag

IMPORTING
SYSTEM = "Name of SAP R/3 System
TIME = "Date and Time, Current Application Server Time
DATE = "Date and time, current (application server) date
STARTUP_TIME = "Date and Time, Current Application Server Time
STARTUP_DATE = "Date and time, current (application server) date
RESET_TIME = "Date and Time, Current Application Server Time
RESET_DATE = "Date and time, current (application server) date
DELTA_TIME = "Date and Time, Current Application Server Time
DELTA_DATE = "Natural number

TABLES
* SEGSTAT = "Segment statistics

EXCEPTIONS
WRONG_DATABASE = 1 WRONG_ORACLE_RELEASE = 2 COLLECTOR_NOT_SET_IN_TCOLL = 3 RESET_OLDER_THAN_STARTUP = 4
.



IMPORTING Parameters details for GET_DB_ORA_SEGSTAT

N_ROWS - Natural number

Data type: INT4
Default: 50
Optional: Yes
Call by Reference: Yes

PROCESS - Single-character flag

Data type: CHAR1
Default: 'D'
Optional: Yes
Call by Reference: Yes

INST_ID - Not More Closely Defined Area, Possibly Used for Patchlevels

Data type: CHAR4
Default: ' '
Optional: Yes
Call by Reference: Yes

TAB_NB - Single-character flag

Data type: CHAR1
Default: '1'
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for GET_DB_ORA_SEGSTAT

SYSTEM - Name of SAP R/3 System

Data type: SY-SYSID
Optional: No
Call by Reference: Yes

TIME - Date and Time, Current Application Server Time

Data type: SY-UZEIT
Optional: No
Call by Reference: Yes

DATE - Date and time, current (application server) date

Data type: SY-DATUM
Optional: No
Call by Reference: Yes

STARTUP_TIME - Date and Time, Current Application Server Time

Data type: SY-UZEIT
Optional: No
Call by Reference: Yes

STARTUP_DATE - Date and time, current (application server) date

Data type: SY-DATUM
Optional: No
Call by Reference: Yes

RESET_TIME - Date and Time, Current Application Server Time

Data type: SY-UZEIT
Optional: No
Call by Reference: Yes

RESET_DATE - Date and time, current (application server) date

Data type: SY-DATUM
Optional: No
Call by Reference: Yes

DELTA_TIME - Date and Time, Current Application Server Time

Data type: SY-UZEIT
Optional: No
Call by Reference: Yes

DELTA_DATE - Natural number

Data type: INT4
Optional: No
Call by Reference: Yes

TABLES Parameters details for GET_DB_ORA_SEGSTAT

SEGSTAT - Segment statistics

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

EXCEPTIONS details

WRONG_DATABASE - Non-Oracle DB.

Data type:
Optional: No
Call by Reference: Yes

WRONG_ORACLE_RELEASE - Wrong oracle release.

Data type:
Optional: No
Call by Reference: Yes

COLLECTOR_NOT_SET_IN_TCOLL - Check if the collector an tables were set up

Data type:
Optional: No
Call by Reference: Yes

RESET_OLDER_THAN_STARTUP - Reset older than statrt up

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for GET_DB_ORA_SEGSTAT 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_n_rows  TYPE INT4, "   50
lv_system  TYPE SY-SYSID, "   
lt_segstat  TYPE STANDARD TABLE OF SEGSTAT, "   
lv_wrong_database  TYPE SEGSTAT, "   
lv_time  TYPE SY-UZEIT, "   
lv_process  TYPE CHAR1, "   'D'
lv_wrong_oracle_release  TYPE CHAR1, "   
lv_date  TYPE SY-DATUM, "   
lv_inst_id  TYPE CHAR4, "   ' '
lv_collector_not_set_in_tcoll  TYPE CHAR4, "   
lv_tab_nb  TYPE CHAR1, "   '1'
lv_startup_time  TYPE SY-UZEIT, "   
lv_reset_older_than_startup  TYPE SY, "   
lv_startup_date  TYPE SY-DATUM, "   
lv_reset_time  TYPE SY-UZEIT, "   
lv_reset_date  TYPE SY-DATUM, "   
lv_delta_time  TYPE SY-UZEIT, "   
lv_delta_date  TYPE INT4. "   

  CALL FUNCTION 'GET_DB_ORA_SEGSTAT'  "V$SEGSTAT monitoring
    EXPORTING
         N_ROWS = lv_n_rows
         PROCESS = lv_process
         INST_ID = lv_inst_id
         TAB_NB = lv_tab_nb
    IMPORTING
         SYSTEM = lv_system
         TIME = lv_time
         DATE = lv_date
         STARTUP_TIME = lv_startup_time
         STARTUP_DATE = lv_startup_date
         RESET_TIME = lv_reset_time
         RESET_DATE = lv_reset_date
         DELTA_TIME = lv_delta_time
         DELTA_DATE = lv_delta_date
    TABLES
         SEGSTAT = lt_segstat
    EXCEPTIONS
        WRONG_DATABASE = 1
        WRONG_ORACLE_RELEASE = 2
        COLLECTOR_NOT_SET_IN_TCOLL = 3
        RESET_OLDER_THAN_STARTUP = 4
. " GET_DB_ORA_SEGSTAT




ABAP code using 7.40 inline data declarations to call FM GET_DB_ORA_SEGSTAT

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_n_rows) = 50.
 
"SELECT single SYSID FROM SY INTO @DATA(ld_system).
 
 
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_time).
 
DATA(ld_process) = 'D'.
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_date).
 
DATA(ld_inst_id) = ' '.
 
 
DATA(ld_tab_nb) = '1'.
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_startup_time).
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_startup_date).
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_reset_time).
 
"SELECT single DATUM FROM SY INTO @DATA(ld_reset_date).
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_delta_time).
 
 


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!