SAP DD_DB_OPERATION Function Module for
DD_DB_OPERATION is a standard dd db operation SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 db operation FM, simply by entering the name DD_DB_OPERATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDDD
Program Name: SAPLSDDD
Main Program: SAPLSDDD
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function DD_DB_OPERATION 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_DB_OPERATION'".
EXPORTING
* FCT = 'NOP' "'CRE', 'DEL', 'CNV', 'MDF', 'MDF'
* STAT = "
* CTRL_CHK = "
* CHK_IGNORE = "
* FORCED = ' ' "'X' = function forced; ' ' = with comparator
* ID_NAME = ' ' "Identifier of a view or matchcode ID
OBJ_NAME = "Name of DD object
OBJ_TYPE = "'TABL', 'SQLT', 'INDX', 'VIEW'
PRID = "Log ID of the log to be written
* STATUS = 'D' "'I' = inactive nametab, 'D' = Dictionary
* USER = ' ' "
* OPTIONS = "Stsructure for Conversion Options
IMPORTING
SUBRC = "0 = OK; otherwise error
DATA_COPY = "Convert with or without data copy
EXCEPTIONS
UNEXPECTED_ERROR = 1 UNSUPPORTED_FUNCTION = 2 UNSUPPORTED_OBJ_TYPE = 3 UNSUPPORTED_STATUS = 4 OBJECT_LOCKED = 5 OP_FAILURE = 6
IMPORTING Parameters details for DD_DB_OPERATION
FCT - 'CRE', 'DEL', 'CNV', 'MDF', 'MDF'
Data type: TBATG-FCTDefault: 'NOP'
Optional: Yes
Call by Reference: No ( called with pass by value option)
STAT -
Data type: DDLCHOptional: Yes
Call by Reference: No ( called with pass by value option)
CTRL_CHK -
Data type: DDCNVCHKCTRLOptional: Yes
Call by Reference: No ( called with pass by value option)
CHK_IGNORE -
Data type: DDBOOL_DOptional: Yes
Call by Reference: No ( called with pass by value option)
FORCED - 'X' = function forced; ' ' = with comparator
Data type: DD02L-AS4LOCALDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ID_NAME - Identifier of a view or matchcode ID
Data type: DD12L-INDEXNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJ_NAME - Name of DD object
Data type: TBATG-TABNAMEOptional: No
Call by Reference: No ( called with pass by value option)
OBJ_TYPE - 'TABL', 'SQLT', 'INDX', 'VIEW'
Data type: TBATG-OBJECTOptional: No
Call by Reference: No ( called with pass by value option)
PRID - Log ID of the log to be written
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
STATUS - 'I' = inactive nametab, 'D' = Dictionary
Data type: DDXTT-MODEFLAGDefault: 'D'
Optional: Yes
Call by Reference: No ( called with pass by value option)
USER -
Data type: SY-UNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OPTIONS - Stsructure for Conversion Options
Data type: DDCNVOPTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_DB_OPERATION
SUBRC - 0 = OK; otherwise error
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
DATA_COPY - Convert with or without data copy
Data type: DDREFSTRUC-BOOLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
UNEXPECTED_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNSUPPORTED_FUNCTION - Operation Not Supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNSUPPORTED_OBJ_TYPE - Unknown object type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNSUPPORTED_STATUS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_LOCKED -
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_DB_OPERATION 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_fct | TYPE TBATG-FCT, " 'NOP' | |||
| lv_subrc | TYPE SY-SUBRC, " | |||
| lv_unexpected_error | TYPE SY, " | |||
| lv_stat | TYPE DDLCH, " | |||
| lv_ctrl_chk | TYPE DDCNVCHKCTRL, " | |||
| lv_chk_ignore | TYPE DDBOOL_D, " | |||
| lv_forced | TYPE DD02L-AS4LOCAL, " SPACE | |||
| lv_data_copy | TYPE DDREFSTRUC-BOOL, " | |||
| lv_unsupported_function | TYPE DDREFSTRUC, " | |||
| lv_id_name | TYPE DD12L-INDEXNAME, " SPACE | |||
| lv_unsupported_obj_type | TYPE DD12L, " | |||
| lv_obj_name | TYPE TBATG-TABNAME, " | |||
| lv_unsupported_status | TYPE TBATG, " | |||
| lv_obj_type | TYPE TBATG-OBJECT, " | |||
| lv_object_locked | TYPE TBATG, " | |||
| lv_prid | TYPE SY-TABIX, " | |||
| lv_op_failure | TYPE SY, " | |||
| lv_status | TYPE DDXTT-MODEFLAG, " 'D' | |||
| lv_user | TYPE SY-UNAME, " SPACE | |||
| lv_options | TYPE DDCNVOPT. " |
|   CALL FUNCTION 'DD_DB_OPERATION' " |
| EXPORTING | ||
| FCT | = lv_fct | |
| STAT | = lv_stat | |
| CTRL_CHK | = lv_ctrl_chk | |
| CHK_IGNORE | = lv_chk_ignore | |
| FORCED | = lv_forced | |
| ID_NAME | = lv_id_name | |
| OBJ_NAME | = lv_obj_name | |
| OBJ_TYPE | = lv_obj_type | |
| PRID | = lv_prid | |
| STATUS | = lv_status | |
| USER | = lv_user | |
| OPTIONS | = lv_options | |
| IMPORTING | ||
| SUBRC | = lv_subrc | |
| DATA_COPY | = lv_data_copy | |
| EXCEPTIONS | ||
| UNEXPECTED_ERROR = 1 | ||
| UNSUPPORTED_FUNCTION = 2 | ||
| UNSUPPORTED_OBJ_TYPE = 3 | ||
| UNSUPPORTED_STATUS = 4 | ||
| OBJECT_LOCKED = 5 | ||
| OP_FAILURE = 6 | ||
| . " DD_DB_OPERATION | ||
ABAP code using 7.40 inline data declarations to call FM DD_DB_OPERATION
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 FCT FROM TBATG INTO @DATA(ld_fct). | ||||
| DATA(ld_fct) | = 'NOP'. | |||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_subrc). | ||||
| "SELECT single AS4LOCAL FROM DD02L INTO @DATA(ld_forced). | ||||
| DATA(ld_forced) | = ' '. | |||
| "SELECT single BOOL FROM DDREFSTRUC INTO @DATA(ld_data_copy). | ||||
| "SELECT single INDEXNAME FROM DD12L INTO @DATA(ld_id_name). | ||||
| DATA(ld_id_name) | = ' '. | |||
| "SELECT single TABNAME FROM TBATG INTO @DATA(ld_obj_name). | ||||
| "SELECT single OBJECT FROM TBATG INTO @DATA(ld_obj_type). | ||||
| "SELECT single TABIX FROM SY INTO @DATA(ld_prid). | ||||
| "SELECT single MODEFLAG FROM DDXTT INTO @DATA(ld_status). | ||||
| DATA(ld_status) | = 'D'. | |||
| "SELECT single UNAME FROM SY INTO @DATA(ld_user). | ||||
| DATA(ld_user) | = ' '. | |||
Search for further information about these or an SAP related objects