SAP DMC_ANALYZE_TABLE_COLUMNS Function Module for analyze values of a table column









DMC_ANALYZE_TABLE_COLUMNS is a standard dmc analyze table columns SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for analyze values of a table column 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 dmc analyze table columns FM, simply by entering the name DMC_ANALYZE_TABLE_COLUMNS into the relevant SAP transaction such as SE37 or SE38.

Function Group: CNV0
Program Name: SAPLCNV0
Main Program: SAPLCNV0
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function DMC_ANALYZE_TABLE_COLUMNS 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 'DMC_ANALYZE_TABLE_COLUMNS'"analyze values of a table column
EXPORTING
IM_TABNAME = "table name
IM_FIELDNAME = "field name
* I_ONLY_MAXCOUNT = '-' "
* I_NO_OF_DISTINCT = 999999999 "number of records with this value
* I_MAX_NO_RECORDS = 999999999 "number of records with this value

IMPORTING
EX_MAX_VALUE = "field value for which the maximum is reached
EX_MAX_COUNT = "maximum number of records for a field value
EX_TABLEN = "table width in bytes

TABLES
* IM_WHERE_CLAUSE = "
* EX_ANALYSIS = "analysis results (values/occurrences)

EXCEPTIONS
INVALID_TABNAME = 1 INVALID_FIELDNAME = 2 INVALID_TABCLASS = 3 NO_AUTHORITY = 4
.



IMPORTING Parameters details for DMC_ANALYZE_TABLE_COLUMNS

IM_TABNAME - table name

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

IM_FIELDNAME - field name

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

I_ONLY_MAXCOUNT -

Data type: DD02L-CLIDEP
Default: '-'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NO_OF_DISTINCT - number of records with this value

Data type: DMCTABANA-CNT
Default: 999999999
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MAX_NO_RECORDS - number of records with this value

Data type: DMCTABANA-CNT
Default: 999999999
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for DMC_ANALYZE_TABLE_COLUMNS

EX_MAX_VALUE - field value for which the maximum is reached

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

EX_MAX_COUNT - maximum number of records for a field value

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

EX_TABLEN - table width in bytes

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

TABLES Parameters details for DMC_ANALYZE_TABLE_COLUMNS

IM_WHERE_CLAUSE -

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

EX_ANALYSIS - analysis results (values/occurrences)

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

EXCEPTIONS details

INVALID_TABNAME - table does not exist

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

INVALID_FIELDNAME - field doesn't exist in table

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

INVALID_TABCLASS - table is cluster/pool

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

NO_AUTHORITY -

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

Copy and paste ABAP code example for DMC_ANALYZE_TABLE_COLUMNS 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_im_tabname  TYPE DD02L-TABNAME, "   
lv_ex_max_value  TYPE DMCTABANA-VALUE, "   
lt_im_where_clause  TYPE STANDARD TABLE OF DMC_QRY, "   
lv_invalid_tabname  TYPE DMC_QRY, "   
lt_ex_analysis  TYPE STANDARD TABLE OF DMCTABANA, "   
lv_ex_max_count  TYPE DMCTABANA-CNT, "   
lv_im_fieldname  TYPE DD03L-FIELDNAME, "   
lv_invalid_fieldname  TYPE DD03L, "   
lv_ex_tablen  TYPE DMCTABANA-CNT, "   
lv_i_only_maxcount  TYPE DD02L-CLIDEP, "   '-'
lv_invalid_tabclass  TYPE DD02L, "   
lv_no_authority  TYPE DD02L, "   
lv_i_no_of_distinct  TYPE DMCTABANA-CNT, "   999999999
lv_i_max_no_records  TYPE DMCTABANA-CNT. "   999999999

  CALL FUNCTION 'DMC_ANALYZE_TABLE_COLUMNS'  "analyze values of a table column
    EXPORTING
         IM_TABNAME = lv_im_tabname
         IM_FIELDNAME = lv_im_fieldname
         I_ONLY_MAXCOUNT = lv_i_only_maxcount
         I_NO_OF_DISTINCT = lv_i_no_of_distinct
         I_MAX_NO_RECORDS = lv_i_max_no_records
    IMPORTING
         EX_MAX_VALUE = lv_ex_max_value
         EX_MAX_COUNT = lv_ex_max_count
         EX_TABLEN = lv_ex_tablen
    TABLES
         IM_WHERE_CLAUSE = lt_im_where_clause
         EX_ANALYSIS = lt_ex_analysis
    EXCEPTIONS
        INVALID_TABNAME = 1
        INVALID_FIELDNAME = 2
        INVALID_TABCLASS = 3
        NO_AUTHORITY = 4
. " DMC_ANALYZE_TABLE_COLUMNS




ABAP code using 7.40 inline data declarations to call FM DMC_ANALYZE_TABLE_COLUMNS

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 TABNAME FROM DD02L INTO @DATA(ld_im_tabname).
 
"SELECT single VALUE FROM DMCTABANA INTO @DATA(ld_ex_max_value).
 
 
 
 
"SELECT single CNT FROM DMCTABANA INTO @DATA(ld_ex_max_count).
 
"SELECT single FIELDNAME FROM DD03L INTO @DATA(ld_im_fieldname).
 
 
"SELECT single CNT FROM DMCTABANA INTO @DATA(ld_ex_tablen).
 
"SELECT single CLIDEP FROM DD02L INTO @DATA(ld_i_only_maxcount).
DATA(ld_i_only_maxcount) = '-'.
 
 
 
"SELECT single CNT FROM DMCTABANA INTO @DATA(ld_i_no_of_distinct).
DATA(ld_i_no_of_distinct) = 999999999.
 
"SELECT single CNT FROM DMCTABANA INTO @DATA(ld_i_max_no_records).
DATA(ld_i_max_no_records) = 999999999.
 


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!