SAP DD_TABL_LENGTH_GET Function Module for DD: Compute key, data and total length of a table
DD_TABL_LENGTH_GET is a standard dd tabl length get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for DD: Compute key, data and total length of a table 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 dd tabl length get FM, simply by entering the name DD_TABL_LENGTH_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDTC
Program Name: SAPLSDTC
Main Program: SAPLSDTC
Appliation area: S
Release date: 08-Dec-1997
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DD_TABL_LENGTH_GET 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 'DD_TABL_LENGTH_GET'"DD: Compute key, data and total length of a table.
EXPORTING
TABNAME = "Table Name
* DD02V_WA = "Table Header
* INCL_ALIGN = ' ' "'':DD length, 'X':nametab length with alignment
IMPORTING
DATALENGTH = "Data Length
KEYLENGTH = "Key length
TABLELENGTH = "Table length
TABLES
DD03P_TAB = "Table Fields
EXCEPTIONS
WRONG_TABNAME = 1 OP_FAILURE = 2
IMPORTING Parameters details for DD_TABL_LENGTH_GET
TABNAME - Table Name
Data type: DD02L-TABNAMEOptional: No
Call by Reference: No ( called with pass by value option)
DD02V_WA - Table Header
Data type: DD02VOptional: Yes
Call by Reference: No ( called with pass by value option)
INCL_ALIGN - '':DD length, 'X':nametab length with alignment
Data type: DDREFSTRUC-BOOLDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_TABL_LENGTH_GET
DATALENGTH - Data Length
Data type: DD03P-INTLENOptional: No
Call by Reference: No ( called with pass by value option)
KEYLENGTH - Key length
Data type: DD03P-INTLENOptional: No
Call by Reference: No ( called with pass by value option)
TABLELENGTH - Table length
Data type: DD03P-INTLENOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for DD_TABL_LENGTH_GET
DD03P_TAB - Table Fields
Data type: DD03POptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
WRONG_TABNAME - Wrong Table Name
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OP_FAILURE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DD_TABL_LENGTH_GET 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_tabname | TYPE DD02L-TABNAME, " | |||
| lt_dd03p_tab | TYPE STANDARD TABLE OF DD03P, " | |||
| lv_datalength | TYPE DD03P-INTLEN, " | |||
| lv_wrong_tabname | TYPE DD03P, " | |||
| lv_dd02v_wa | TYPE DD02V, " | |||
| lv_keylength | TYPE DD03P-INTLEN, " | |||
| lv_op_failure | TYPE DD03P, " | |||
| lv_incl_align | TYPE DDREFSTRUC-BOOL, " ' ' | |||
| lv_tablelength | TYPE DD03P-INTLEN. " |
|   CALL FUNCTION 'DD_TABL_LENGTH_GET' "DD: Compute key, data and total length of a table |
| EXPORTING | ||
| TABNAME | = lv_tabname | |
| DD02V_WA | = lv_dd02v_wa | |
| INCL_ALIGN | = lv_incl_align | |
| IMPORTING | ||
| DATALENGTH | = lv_datalength | |
| KEYLENGTH | = lv_keylength | |
| TABLELENGTH | = lv_tablelength | |
| TABLES | ||
| DD03P_TAB | = lt_dd03p_tab | |
| EXCEPTIONS | ||
| WRONG_TABNAME = 1 | ||
| OP_FAILURE = 2 | ||
| . " DD_TABL_LENGTH_GET | ||
ABAP code using 7.40 inline data declarations to call FM DD_TABL_LENGTH_GET
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_tabname). | ||||
| "SELECT single INTLEN FROM DD03P INTO @DATA(ld_datalength). | ||||
| "SELECT single INTLEN FROM DD03P INTO @DATA(ld_keylength). | ||||
| "SELECT single BOOL FROM DDREFSTRUC INTO @DATA(ld_incl_align). | ||||
| DATA(ld_incl_align) | = ' '. | |||
| "SELECT single INTLEN FROM DD03P INTO @DATA(ld_tablelength). | ||||
Search for further information about these or an SAP related objects