SAP DBC2ABAP_SQLSTATISTICS Function Module for ABAP SQL Service: SQLPrimaryKeys Function
DBC2ABAP_SQLSTATISTICS is a standard dbc2abap sqlstatistics SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for ABAP SQL Service: SQLPrimaryKeys Function 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 dbc2abap sqlstatistics FM, simply by entering the name DBC2ABAP_SQLSTATISTICS into the relevant SAP transaction such as SE37 or SE38.
Function Group: DBC2ABAP
Program Name: SAPLDBC2ABAP
Main Program: SAPLDBC2ABAP
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function DBC2ABAP_SQLSTATISTICS 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 'DBC2ABAP_SQLSTATISTICS'"ABAP SQL Service: SQLPrimaryKeys Function.
EXPORTING
IM_CATALOG_NAME = "Exact Name/ID of Catalog
IM_SCHEMA_NAME = "Exact Name/ID of Schema
IM_TABLE_NAME = "Exact Name/ID of Table/View
IM_STMT_ATTR_METADATA_ID = "Truth Value: True/False
IM_UNIQUE = "type of index
IM_RESERVED = "importance of stats columns
IMPORTING
EX_MSG_INFO = "
EX_RESULT = "ABAP SQL Service: Return Table for SQLPrimaryKeys
EX_STMT_RES_SETS = "Description of result sets
IMPORTING Parameters details for DBC2ABAP_SQLSTATISTICS
IM_CATALOG_NAME - Exact Name/ID of Catalog
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
IM_SCHEMA_NAME - Exact Name/ID of Schema
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
IM_TABLE_NAME - Exact Name/ID of Table/View
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
IM_STMT_ATTR_METADATA_ID - Truth Value: True/False
Data type: ABAP_BOOLEANOptional: No
Call by Reference: No ( called with pass by value option)
IM_UNIQUE - type of index
Data type: INT2Optional: No
Call by Reference: No ( called with pass by value option)
IM_RESERVED - importance of stats columns
Data type: INT2Optional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DBC2ABAP_SQLSTATISTICS
EX_MSG_INFO -
Data type: DBC2ABAP_MSG_INFOOptional: No
Call by Reference: No ( called with pass by value option)
EX_RESULT - ABAP SQL Service: Return Table for SQLPrimaryKeys
Data type: DBC2ABAP_SQLSTATISTICS_TABOptional: No
Call by Reference: No ( called with pass by value option)
EX_STMT_RES_SETS - Description of result sets
Data type: DBC2ABAP_RESULT_SET_DESCR_TOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DBC2ABAP_SQLSTATISTICS 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_ex_msg_info | TYPE DBC2ABAP_MSG_INFO, " | |||
| lv_im_catalog_name | TYPE STRING, " | |||
| lv_ex_result | TYPE DBC2ABAP_SQLSTATISTICS_TAB, " | |||
| lv_im_schema_name | TYPE STRING, " | |||
| lv_im_table_name | TYPE STRING, " | |||
| lv_ex_stmt_res_sets | TYPE DBC2ABAP_RESULT_SET_DESCR_T, " | |||
| lv_im_stmt_attr_metadata_id | TYPE ABAP_BOOLEAN, " | |||
| lv_im_unique | TYPE INT2, " | |||
| lv_im_reserved | TYPE INT2. " |
|   CALL FUNCTION 'DBC2ABAP_SQLSTATISTICS' "ABAP SQL Service: SQLPrimaryKeys Function |
| EXPORTING | ||
| IM_CATALOG_NAME | = lv_im_catalog_name | |
| IM_SCHEMA_NAME | = lv_im_schema_name | |
| IM_TABLE_NAME | = lv_im_table_name | |
| IM_STMT_ATTR_METADATA_ID | = lv_im_stmt_attr_metadata_id | |
| IM_UNIQUE | = lv_im_unique | |
| IM_RESERVED | = lv_im_reserved | |
| IMPORTING | ||
| EX_MSG_INFO | = lv_ex_msg_info | |
| EX_RESULT | = lv_ex_result | |
| EX_STMT_RES_SETS | = lv_ex_stmt_res_sets | |
| . " DBC2ABAP_SQLSTATISTICS | ||
ABAP code using 7.40 inline data declarations to call FM DBC2ABAP_SQLSTATISTICS
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.Search for further information about these or an SAP related objects