SAP BAPI_RECORD_DELETEELEMENTS Function Module for Delete Multiple Elements From Record









BAPI_RECORD_DELETEELEMENTS is a standard bapi record deleteelements 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 Multiple Elements From Record 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 bapi record deleteelements FM, simply by entering the name BAPI_RECORD_DELETEELEMENTS into the relevant SAP transaction such as SE37 or SE38.

Function Group: SRM_BAPI_RECORD
Program Name: SAPLSRM_BAPI_RECORD
Main Program: SAPLSRM_BAPI_RECORD
Appliation area:
Release date: 31-Oct-2001
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_RECORD_DELETEELEMENTS 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 'BAPI_RECORD_DELETEELEMENTS'"Delete Multiple Elements From Record
EXPORTING
OBJECTID = "Internal ID of Record
DOCUMENTCLASS = "Record Location
* DEL_ALL_NOT_UNIQUE_ELEMS = ' ' "Indicator: Delete all elements that occur more than once in the record
* SKIP_ELEMS_WITH_ERROR = 'X' "Indicator: Ignore Elements with Errors
* STORE_AS_NEW_VERSION = ' ' "Indicator: Create New Logical Version of Record?
* DOC_CONTEXT = "SRM Context for Document Access
* IGNORE_CONNECTION_FAILED = ' ' "Ignores the exception if the element no longer exists

TABLES
* ELEM_IDENT_RECPOS = "Identification of Elements to be Deleted Using Record Position
* ELEM_IDENT_SP_POID = "Service Provider-Specific Identification of Elements to be Deleted
RETURN = "Return Code
.



IMPORTING Parameters details for BAPI_RECORD_DELETEELEMENTS

OBJECTID - Internal ID of Record

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

DOCUMENTCLASS - Record Location

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

DEL_ALL_NOT_UNIQUE_ELEMS - Indicator: Delete all elements that occur more than once in the record

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

SKIP_ELEMS_WITH_ERROR - Indicator: Ignore Elements with Errors

Data type: BAPISRMREC-BOOLEAN
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

STORE_AS_NEW_VERSION - Indicator: Create New Logical Version of Record?

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

DOC_CONTEXT - SRM Context for Document Access

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

IGNORE_CONNECTION_FAILED - Ignores the exception if the element no longer exists

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

TABLES Parameters details for BAPI_RECORD_DELETEELEMENTS

ELEM_IDENT_RECPOS - Identification of Elements to be Deleted Using Record Position

Data type: BAPIRECPOS
Optional: Yes
Call by Reference: Yes

ELEM_IDENT_SP_POID - Service Provider-Specific Identification of Elements to be Deleted

Data type: BAPIPROPME
Optional: Yes
Call by Reference: Yes

RETURN - Return Code

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

Copy and paste ABAP code example for BAPI_RECORD_DELETEELEMENTS 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_objectid  TYPE BAPISRMREC-GUID, "   
lt_elem_ident_recpos  TYPE STANDARD TABLE OF BAPIRECPOS, "   
lv_documentclass  TYPE BAPISRMREC-DOCCLASS, "   
lt_elem_ident_sp_poid  TYPE STANDARD TABLE OF BAPIPROPME, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_del_all_not_unique_elems  TYPE BAPISRMREC-BOOLEAN, "   ' '
lv_skip_elems_with_error  TYPE BAPISRMREC-BOOLEAN, "   'X'
lv_store_as_new_version  TYPE BAPISRMREC-BOOLEAN, "   ' '
lv_doc_context  TYPE BAPIDOCCONTEXT, "   
lv_ignore_connection_failed  TYPE BAPISRMREC-BOOLEAN. "   ' '

  CALL FUNCTION 'BAPI_RECORD_DELETEELEMENTS'  "Delete Multiple Elements From Record
    EXPORTING
         OBJECTID = lv_objectid
         DOCUMENTCLASS = lv_documentclass
         DEL_ALL_NOT_UNIQUE_ELEMS = lv_del_all_not_unique_elems
         SKIP_ELEMS_WITH_ERROR = lv_skip_elems_with_error
         STORE_AS_NEW_VERSION = lv_store_as_new_version
         DOC_CONTEXT = lv_doc_context
         IGNORE_CONNECTION_FAILED = lv_ignore_connection_failed
    TABLES
         ELEM_IDENT_RECPOS = lt_elem_ident_recpos
         ELEM_IDENT_SP_POID = lt_elem_ident_sp_poid
         RETURN = lt_return
. " BAPI_RECORD_DELETEELEMENTS




ABAP code using 7.40 inline data declarations to call FM BAPI_RECORD_DELETEELEMENTS

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 GUID FROM BAPISRMREC INTO @DATA(ld_objectid).
 
 
"SELECT single DOCCLASS FROM BAPISRMREC INTO @DATA(ld_documentclass).
 
 
 
"SELECT single BOOLEAN FROM BAPISRMREC INTO @DATA(ld_del_all_not_unique_elems).
DATA(ld_del_all_not_unique_elems) = ' '.
 
"SELECT single BOOLEAN FROM BAPISRMREC INTO @DATA(ld_skip_elems_with_error).
DATA(ld_skip_elems_with_error) = 'X'.
 
"SELECT single BOOLEAN FROM BAPISRMREC INTO @DATA(ld_store_as_new_version).
DATA(ld_store_as_new_version) = ' '.
 
 
"SELECT single BOOLEAN FROM BAPISRMREC INTO @DATA(ld_ignore_connection_failed).
DATA(ld_ignore_connection_failed) = ' '.
 


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!