SAP Function Modules

STU3_GET_STATEMENT_STATISTICS SAP Function module







STU3_GET_STATEMENT_STATISTICS is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name STU3_GET_STATEMENT_STATISTICS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: STU3
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM STU3_GET_STATEMENT_STATISTICS - STU3 GET STATEMENT STATISTICS





CALL FUNCTION 'STU3_GET_STATEMENT_STATISTICS' "
* EXPORTING
*   remote_dbcon =              " dbcon-con_name  Logical name for a database connection
*   fb_dsctype =                " sy-subrc      Return Value of ABAP Statements
*   fb_dsclist =                " sy-subrc      Return Value of ABAP Statements
*   fb_dscvalue =               " sy-subrc      Return Value of ABAP Statements
*   fb_dscvalue2 =              " sy-subrc      Return Value of ABAP Statements
*   fb_retry =                  " db2qclreq-retry  retry count
*   ds_member_spec =            " db2dsmem-memb_name  Name of the data sharing group member
*   get_long_sql =              " db2cchar01    Field type char, length 1
  IMPORTING
    fb_dschdr =                 " db2dsshdr     Header for statement cache statistics
    fb_dsecprocd =              " db2qclreq-dsecprocd  number of data sections processed
    fb_dsecnprocd =             " db2qclreq-dsecnprocd  number of data sections not processed
    ds_member_used =            " db2dsmem-memb_name  Name of the data sharing group member
  TABLES
    fb_statement_tab =          " db2qstc       Structure for Statement Trace
*   fb_filter_tab =             " db2dscfilter_tab  Statement Cache Filters
  EXCEPTIONS
    RS_AUTH_FAILURE = 1         "
    RS_START_TRACE = 2          "
    RS_INTERNAL_ERROR = 3       "
    RS_DYN_CACH_NA = 4          "
    RS_NO_CACH_STMTS = 5        "
    RS_DSC_PTF_MISSING = 6      "
    RS_NOT_COMPLETE = 7         "
    REQUEST_TO_OLD = 8          "
    NO_BUFFER_SPACE_IN_SHM = 9  "
    UNVALID_REQUEST_ID = 10     "
    ANSWER_IS_NOT_YET_AVAILABLE = 11  "
    COMMUNICATION_ERROR = 12    "
    ANSWER_NOT_POSSIBLE = 13    "
    COMMUNICATION_BUFFER_TO_SMALL = 14  "
    UNKNOWN_ERROR = 15          "
    ILLEGAL_PARAMETER = 16      "
    IFI_ERROR = 17              "
    OTHER_EXCEPTION = 18        "
    OTHERS = 19                 "
    .  "  STU3_GET_STATEMENT_STATISTICS

ABAP code example for Function Module STU3_GET_STATEMENT_STATISTICS





The ABAP code below is a full code listing to execute function module STU3_GET_STATEMENT_STATISTICS including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_fb_dschdr  TYPE DB2DSSHDR ,
ld_fb_dsecprocd  TYPE DB2QCLREQ-DSECPROCD ,
ld_fb_dsecnprocd  TYPE DB2QCLREQ-DSECNPROCD ,
ld_ds_member_used  TYPE DB2DSMEM-MEMB_NAME ,
it_fb_statement_tab  TYPE STANDARD TABLE OF DB2QSTC,"TABLES PARAM
wa_fb_statement_tab  LIKE LINE OF it_fb_statement_tab ,
it_fb_filter_tab  TYPE STANDARD TABLE OF DB2DSCFILTER_TAB,"TABLES PARAM
wa_fb_filter_tab  LIKE LINE OF it_fb_filter_tab .


SELECT single CON_NAME
FROM DBCON
INTO @DATA(ld_remote_dbcon).

DATA(ld_fb_dsctype) = '20210129'.
DATA(ld_fb_dsclist) = '20210129'.
DATA(ld_fb_dscvalue) = '20210129'.
DATA(ld_fb_dscvalue2) = '20210129'.

DATA(ld_fb_retry) = 123

DATA(ld_ds_member_spec) = some text here
DATA(ld_get_long_sql) = '20210129'.

"populate fields of struture and append to itab
append wa_fb_statement_tab to it_fb_statement_tab.

"populate fields of struture and append to itab
append wa_fb_filter_tab to it_fb_filter_tab. . CALL FUNCTION 'STU3_GET_STATEMENT_STATISTICS' * EXPORTING * remote_dbcon = ld_remote_dbcon * fb_dsctype = ld_fb_dsctype * fb_dsclist = ld_fb_dsclist * fb_dscvalue = ld_fb_dscvalue * fb_dscvalue2 = ld_fb_dscvalue2 * fb_retry = ld_fb_retry * ds_member_spec = ld_ds_member_spec * get_long_sql = ld_get_long_sql IMPORTING fb_dschdr = ld_fb_dschdr fb_dsecprocd = ld_fb_dsecprocd fb_dsecnprocd = ld_fb_dsecnprocd ds_member_used = ld_ds_member_used TABLES fb_statement_tab = it_fb_statement_tab * fb_filter_tab = it_fb_filter_tab EXCEPTIONS RS_AUTH_FAILURE = 1 RS_START_TRACE = 2 RS_INTERNAL_ERROR = 3 RS_DYN_CACH_NA = 4 RS_NO_CACH_STMTS = 5 RS_DSC_PTF_MISSING = 6 RS_NOT_COMPLETE = 7 REQUEST_TO_OLD = 8 NO_BUFFER_SPACE_IN_SHM = 9 UNVALID_REQUEST_ID = 10 ANSWER_IS_NOT_YET_AVAILABLE = 11 COMMUNICATION_ERROR = 12 ANSWER_NOT_POSSIBLE = 13 COMMUNICATION_BUFFER_TO_SMALL = 14 UNKNOWN_ERROR = 15 ILLEGAL_PARAMETER = 16 IFI_ERROR = 17 OTHER_EXCEPTION = 18 OTHERS = 19 . " STU3_GET_STATEMENT_STATISTICS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 13. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 14. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 15. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 16. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 17. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 18. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 19. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_fb_dschdr  TYPE DB2DSSHDR ,
ld_remote_dbcon  TYPE DBCON-CON_NAME ,
it_fb_statement_tab  TYPE STANDARD TABLE OF DB2QSTC ,
wa_fb_statement_tab  LIKE LINE OF it_fb_statement_tab,
ld_fb_dsecprocd  TYPE DB2QCLREQ-DSECPROCD ,
ld_fb_dsctype  TYPE SY-SUBRC ,
it_fb_filter_tab  TYPE STANDARD TABLE OF DB2DSCFILTER_TAB ,
wa_fb_filter_tab  LIKE LINE OF it_fb_filter_tab,
ld_fb_dsclist  TYPE SY-SUBRC ,
ld_fb_dsecnprocd  TYPE DB2QCLREQ-DSECNPROCD ,
ld_fb_dscvalue  TYPE SY-SUBRC ,
ld_ds_member_used  TYPE DB2DSMEM-MEMB_NAME ,
ld_fb_dscvalue2  TYPE SY-SUBRC ,
ld_fb_retry  TYPE DB2QCLREQ-RETRY ,
ld_ds_member_spec  TYPE DB2DSMEM-MEMB_NAME ,
ld_get_long_sql  TYPE DB2CCHAR01 .


SELECT single CON_NAME
FROM DBCON
INTO ld_remote_dbcon.


"populate fields of struture and append to itab
append wa_fb_statement_tab to it_fb_statement_tab.
ld_fb_dsctype = '20210129'.

"populate fields of struture and append to itab
append wa_fb_filter_tab to it_fb_filter_tab.
ld_fb_dsclist = '20210129'.
ld_fb_dscvalue = '20210129'.
ld_fb_dscvalue2 = '20210129'.

ld_fb_retry = 123

ld_ds_member_spec = some text here
ld_get_long_sql = '20210129'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name STU3_GET_STATEMENT_STATISTICS or its description.