SAP DD_DDTYPE_TO_ABAPTYPE Function Module for Mapping Dictionary to ABAP/4 Types
DD_DDTYPE_TO_ABAPTYPE is a standard dd ddtype to abaptype SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Mapping Dictionary to ABAP/4 Types 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 ddtype to abaptype FM, simply by entering the name DD_DDTYPE_TO_ABAPTYPE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDDM
Program Name: SAPLSDDM
Main Program: SAPLSDDM
Appliation area:
Release date: 09-Feb-1994
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DD_DDTYPE_TO_ABAPTYPE 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_DDTYPE_TO_ABAPTYPE'"Mapping Dictionary to ABAP/4 Types.
EXPORTING
* DDLEN = '000000' "Dictionary length
* DDTYPE = '' "Dictionary category
IMPORTING
ABCODE = "ABAP/4 coding for nametab
ABLEN = "ABAP/4 length
ABTYPE = "ABAP/4 category
ABTYPE_INT = "
EXCEPTIONS
ILLEGAL_VALUE = 1
IMPORTING Parameters details for DD_DDTYPE_TO_ABAPTYPE
DDLEN - Dictionary length
Data type: DD01V-LENGDefault: '000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DDTYPE - Dictionary category
Data type: DD01V-DATATYPEDefault: ''
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_DDTYPE_TO_ABAPTYPE
ABCODE - ABAP/4 coding for nametab
Data type: X031L-FIELDTYPEOptional: No
Call by Reference: No ( called with pass by value option)
ABLEN - ABAP/4 length
Data type: DD03L-INTLENOptional: No
Call by Reference: No ( called with pass by value option)
ABTYPE - ABAP/4 category
Data type: DD03L-INTTYPEOptional: No
Call by Reference: No ( called with pass by value option)
ABTYPE_INT -
Data type: DD03L-INTTYPEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ILLEGAL_VALUE - Not allowed value of a current parameter
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DD_DDTYPE_TO_ABAPTYPE 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_ddlen | TYPE DD01V-LENG, " '000000' | |||
| lv_abcode | TYPE X031L-FIELDTYPE, " | |||
| lv_illegal_value | TYPE X031L, " | |||
| lv_ablen | TYPE DD03L-INTLEN, " | |||
| lv_ddtype | TYPE DD01V-DATATYPE, " '' | |||
| lv_abtype | TYPE DD03L-INTTYPE, " | |||
| lv_abtype_int | TYPE DD03L-INTTYPE. " |
|   CALL FUNCTION 'DD_DDTYPE_TO_ABAPTYPE' "Mapping Dictionary to ABAP/4 Types |
| EXPORTING | ||
| DDLEN | = lv_ddlen | |
| DDTYPE | = lv_ddtype | |
| IMPORTING | ||
| ABCODE | = lv_abcode | |
| ABLEN | = lv_ablen | |
| ABTYPE | = lv_abtype | |
| ABTYPE_INT | = lv_abtype_int | |
| EXCEPTIONS | ||
| ILLEGAL_VALUE = 1 | ||
| . " DD_DDTYPE_TO_ABAPTYPE | ||
ABAP code using 7.40 inline data declarations to call FM DD_DDTYPE_TO_ABAPTYPE
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 LENG FROM DD01V INTO @DATA(ld_ddlen). | ||||
| DATA(ld_ddlen) | = '000000'. | |||
| "SELECT single FIELDTYPE FROM X031L INTO @DATA(ld_abcode). | ||||
| "SELECT single INTLEN FROM DD03L INTO @DATA(ld_ablen). | ||||
| "SELECT single DATATYPE FROM DD01V INTO @DATA(ld_ddtype). | ||||
| DATA(ld_ddtype) | = ''. | |||
| "SELECT single INTTYPE FROM DD03L INTO @DATA(ld_abtype). | ||||
| "SELECT single INTTYPE FROM DD03L INTO @DATA(ld_abtype_int). | ||||
Search for further information about these or an SAP related objects