SAP DPCOMMON_DELETE_DOCUMENT Function Module for Delete attached doc
DPCOMMON_DELETE_DOCUMENT is a standard dpcommon delete document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Delete attached doc 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 dpcommon delete document FM, simply by entering the name DPCOMMON_DELETE_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: DPCOMMON_ATTACHED_DOC
Program Name: SAPLDPCOMMON_ATTACHED_DOC
Main Program: SAPLDPCOMMON_ATTACHED_DOC
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function DPCOMMON_DELETE_DOCUMENT 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 'DPCOMMON_DELETE_DOCUMENT'"Delete attached doc.
EXPORTING
* IV_LOGICAL_SYSTEM = "Business Document Service: ID of logical systemID of logical
IV_CLASSNAME = "Business Document Service: Class name
IV_CLASSTYPE = "Business Document Service: Class type
* IV_CLIENT = "Client
* IV_OBJECT_KEY = "Business Document Service: Object key
* X_FORCE_DELETE = "BDS: Flag
CHANGING
CT_SIGNATURE = "Table type for structure BAPISIGNAT
* CT_RETURN = "Return parameter table
IMPORTING Parameters details for DPCOMMON_DELETE_DOCUMENT
IV_LOGICAL_SYSTEM - Business Document Service: ID of logical systemID of logical
Data type: BAPIBDS01-LOG_SYSTEMOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_CLASSNAME - Business Document Service: Class name
Data type: BAPIBDS01-CLASSNAMEOptional: No
Call by Reference: No ( called with pass by value option)
IV_CLASSTYPE - Business Document Service: Class type
Data type: BAPIBDS01-CLASSTYPEOptional: No
Call by Reference: No ( called with pass by value option)
IV_CLIENT - Client
Data type: BAPIBDS01-CLIENTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_OBJECT_KEY - Business Document Service: Object key
Data type: BAPIBDS01-OBJKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
X_FORCE_DELETE - BDS: Flag
Data type: BAPIBDS01-XOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for DPCOMMON_DELETE_DOCUMENT
CT_SIGNATURE - Table type for structure BAPISIGNAT
Data type: DPCOMMON_T_BAPISIGNATOptional: No
Call by Reference: No ( called with pass by value option)
CT_RETURN - Return parameter table
Data type: BAPIRET2_TOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DPCOMMON_DELETE_DOCUMENT 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_ct_signature | TYPE DPCOMMON_T_BAPISIGNAT, " | |||
| lv_iv_logical_system | TYPE BAPIBDS01-LOG_SYSTEM, " | |||
| lv_ct_return | TYPE BAPIRET2_T, " | |||
| lv_iv_classname | TYPE BAPIBDS01-CLASSNAME, " | |||
| lv_iv_classtype | TYPE BAPIBDS01-CLASSTYPE, " | |||
| lv_iv_client | TYPE BAPIBDS01-CLIENT, " | |||
| lv_iv_object_key | TYPE BAPIBDS01-OBJKEY, " | |||
| lv_x_force_delete | TYPE BAPIBDS01-X. " |
|   CALL FUNCTION 'DPCOMMON_DELETE_DOCUMENT' "Delete attached doc |
| EXPORTING | ||
| IV_LOGICAL_SYSTEM | = lv_iv_logical_system | |
| IV_CLASSNAME | = lv_iv_classname | |
| IV_CLASSTYPE | = lv_iv_classtype | |
| IV_CLIENT | = lv_iv_client | |
| IV_OBJECT_KEY | = lv_iv_object_key | |
| X_FORCE_DELETE | = lv_x_force_delete | |
| CHANGING | ||
| CT_SIGNATURE | = lv_ct_signature | |
| CT_RETURN | = lv_ct_return | |
| . " DPCOMMON_DELETE_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM DPCOMMON_DELETE_DOCUMENT
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 LOG_SYSTEM FROM BAPIBDS01 INTO @DATA(ld_iv_logical_system). | ||||
| "SELECT single CLASSNAME FROM BAPIBDS01 INTO @DATA(ld_iv_classname). | ||||
| "SELECT single CLASSTYPE FROM BAPIBDS01 INTO @DATA(ld_iv_classtype). | ||||
| "SELECT single CLIENT FROM BAPIBDS01 INTO @DATA(ld_iv_client). | ||||
| "SELECT single OBJKEY FROM BAPIBDS01 INTO @DATA(ld_iv_object_key). | ||||
| "SELECT single X FROM BAPIBDS01 INTO @DATA(ld_x_force_delete). | ||||
Search for further information about these or an SAP related objects