SAP SRM_RECORD_DELETEELEMENTS Function Module for









SRM_RECORD_DELETEELEMENTS is a standard srm 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 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 srm record deleteelements FM, simply by entering the name SRM_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: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SRM_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 'SRM_RECORD_DELETEELEMENTS'"
EXPORTING
OBJECTID = "Internal ID of Record
DOCUMENTCLASS = "File 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 = "
* IGNORE_CONNECTION_FAILED = ' ' "

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

EXCEPTIONS
INTERNAL_ERROR = 1 CONTAINER_IS_LOCKED = 2 POID_IS_WRONG = 3 NOT_AUTHORIZED = 4 PARAMETER_ERROR = 5 ELEMENT_NOT_FOUND = 6 CONTAINER_NOT_FOUND = 7 RECORD_IS_FROZEN = 8
.



IMPORTING Parameters details for SRM_RECORD_DELETEELEMENTS

OBJECTID - Internal ID of Record

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

DOCUMENTCLASS - File 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 -

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

IGNORE_CONNECTION_FAILED -

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

TABLES Parameters details for SRM_RECORD_DELETEELEMENTS

ELEM_IDENT_RECPOS - Identification of Elements to be Deleted Using Record Position

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

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

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

RETURN - Return Code

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

EXCEPTIONS details

INTERNAL_ERROR - Internal Error

Data type:
Optional: No
Call by Reference: Yes

CONTAINER_IS_LOCKED -

Data type:
Optional: No
Call by Reference: Yes

POID_IS_WRONG -

Data type:
Optional: No
Call by Reference: Yes

NOT_AUTHORIZED - User Is Not Authorized

Data type:
Optional: No
Call by Reference: Yes

PARAMETER_ERROR - Parameter error

Data type:
Optional: No
Call by Reference: Yes

ELEMENT_NOT_FOUND - Element Not Found

Data type:
Optional: No
Call by Reference: Yes

CONTAINER_NOT_FOUND -

Data type:
Optional: No
Call by Reference: Yes

RECORD_IS_FROZEN -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for SRM_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, "   
lv_internal_error  TYPE BAPISRMREC, "   
lt_elem_ident_recpos  TYPE STANDARD TABLE OF BAPIRECPOS, "   
lv_documentclass  TYPE BAPISRMREC-DOCCLASS, "   
lt_elem_ident_sp_poid  TYPE STANDARD TABLE OF BAPIPROPME, "   
lv_container_is_locked  TYPE BAPIPROPME, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_poid_is_wrong  TYPE BAPIRET2, "   
lv_del_all_not_unique_elems  TYPE BAPISRMREC-BOOLEAN, "   ' '
lv_not_authorized  TYPE BAPISRMREC, "   
lv_skip_elems_with_error  TYPE BAPISRMREC-BOOLEAN, "   'X'
lv_parameter_error  TYPE BAPISRMREC, "   
lv_store_as_new_version  TYPE BAPISRMREC-BOOLEAN, "   ' '
lv_doc_context  TYPE BAPIDOCCONTEXT, "   
lv_element_not_found  TYPE BAPIDOCCONTEXT, "   
lv_container_not_found  TYPE BAPIDOCCONTEXT, "   
lv_ignore_connection_failed  TYPE BAPISRMREC-BOOLEAN, "   ' '
lv_record_is_frozen  TYPE BAPISRMREC. "   

  CALL FUNCTION 'SRM_RECORD_DELETEELEMENTS'  "
    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
    EXCEPTIONS
        INTERNAL_ERROR = 1
        CONTAINER_IS_LOCKED = 2
        POID_IS_WRONG = 3
        NOT_AUTHORIZED = 4
        PARAMETER_ERROR = 5
        ELEMENT_NOT_FOUND = 6
        CONTAINER_NOT_FOUND = 7
        RECORD_IS_FROZEN = 8
. " SRM_RECORD_DELETEELEMENTS




ABAP code using 7.40 inline data declarations to call FM SRM_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!