SAP SRM_RECORD_CREATE Function Module for
SRM_RECORD_CREATE is a standard srm record create 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 create FM, simply by entering the name SRM_RECORD_CREATE 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_CREATE 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_CREATE'".
EXPORTING
RMS_ID = "Records Management System ID
SPS_ID = "
DOCUMENTID = "
DESCRIPTION = "Description, Does Not Have To Be Unique
MODEL_SPS_ID = "
MODEL = "
* DOCUMENTID_CHECK_UNIQUE = 'X' "Check Uniqueness of the Name for the Record to be Created
IMPORTING
RETURN = "Return Code
OBJECTID = "Internal ID of New Record
DOCUMENTCLASS = "Storage Location of New Record (Content Model)
EXCEPTIONS
NOT_AUTHORIZED = 1 PARAMETER_ERROR = 2 MODEL_NOT_FOUND = 3 MODEL_CORRUPT = 4 REGISTRATION_NUMBER_NOT_UNIQUE = 5 MODEL_STATUS_INVALID = 6 INTERNAL_ERROR = 7
IMPORTING Parameters details for SRM_RECORD_CREATE
RMS_ID - Records Management System ID
Data type: BAPISRMREC-RMSIDOptional: No
Call by Reference: No ( called with pass by value option)
SPS_ID -
Data type: BAPISRMREC-SPSIDOptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTID -
Data type: BAPISRMREC-DOCIDOptional: No
Call by Reference: No ( called with pass by value option)
DESCRIPTION - Description, Does Not Have To Be Unique
Data type: BAPISRMREC-DESCROptional: No
Call by Reference: No ( called with pass by value option)
MODEL_SPS_ID -
Data type: BAPISRMREC-SPSIDOptional: No
Call by Reference: No ( called with pass by value option)
MODEL -
Data type: BAPISRMREC-DOCIDOptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTID_CHECK_UNIQUE - Check Uniqueness of the Name for the Record to be Created
Data type: BAPISRMREC-BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SRM_RECORD_CREATE
RETURN - Return Code
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
OBJECTID - Internal ID of New Record
Data type: BAPISRMREC-GUIDOptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTCLASS - Storage Location of New Record (Content Model)
Data type: BAPISRMREC-DOCCLASSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_AUTHORIZED -
Data type:Optional: No
Call by Reference: Yes
PARAMETER_ERROR - Parameter error
Data type:Optional: No
Call by Reference: Yes
MODEL_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
MODEL_CORRUPT -
Data type:Optional: No
Call by Reference: Yes
REGISTRATION_NUMBER_NOT_UNIQUE -
Data type:Optional: No
Call by Reference: Yes
MODEL_STATUS_INVALID -
Data type:Optional: No
Call by Reference: Yes
INTERNAL_ERROR - Internal Error
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SRM_RECORD_CREATE 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_return | TYPE BAPIRET2, " | |||
| lv_rms_id | TYPE BAPISRMREC-RMSID, " | |||
| lv_not_authorized | TYPE BAPISRMREC, " | |||
| lv_sps_id | TYPE BAPISRMREC-SPSID, " | |||
| lv_objectid | TYPE BAPISRMREC-GUID, " | |||
| lv_parameter_error | TYPE BAPISRMREC, " | |||
| lv_documentid | TYPE BAPISRMREC-DOCID, " | |||
| lv_documentclass | TYPE BAPISRMREC-DOCCLASS, " | |||
| lv_model_not_found | TYPE BAPISRMREC, " | |||
| lv_description | TYPE BAPISRMREC-DESCR, " | |||
| lv_model_corrupt | TYPE BAPISRMREC, " | |||
| lv_model_sps_id | TYPE BAPISRMREC-SPSID, " | |||
| lv_registration_number_not_unique | TYPE BAPISRMREC, " | |||
| lv_model | TYPE BAPISRMREC-DOCID, " | |||
| lv_model_status_invalid | TYPE BAPISRMREC, " | |||
| lv_internal_error | TYPE BAPISRMREC, " | |||
| lv_documentid_check_unique | TYPE BAPISRMREC-BOOLEAN. " 'X' |
|   CALL FUNCTION 'SRM_RECORD_CREATE' " |
| EXPORTING | ||
| RMS_ID | = lv_rms_id | |
| SPS_ID | = lv_sps_id | |
| DOCUMENTID | = lv_documentid | |
| DESCRIPTION | = lv_description | |
| MODEL_SPS_ID | = lv_model_sps_id | |
| MODEL | = lv_model | |
| DOCUMENTID_CHECK_UNIQUE | = lv_documentid_check_unique | |
| IMPORTING | ||
| RETURN | = lv_return | |
| OBJECTID | = lv_objectid | |
| DOCUMENTCLASS | = lv_documentclass | |
| EXCEPTIONS | ||
| NOT_AUTHORIZED = 1 | ||
| PARAMETER_ERROR = 2 | ||
| MODEL_NOT_FOUND = 3 | ||
| MODEL_CORRUPT = 4 | ||
| REGISTRATION_NUMBER_NOT_UNIQUE = 5 | ||
| MODEL_STATUS_INVALID = 6 | ||
| INTERNAL_ERROR = 7 | ||
| . " SRM_RECORD_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM SRM_RECORD_CREATE
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 RMSID FROM BAPISRMREC INTO @DATA(ld_rms_id). | ||||
| "SELECT single SPSID FROM BAPISRMREC INTO @DATA(ld_sps_id). | ||||
| "SELECT single GUID FROM BAPISRMREC INTO @DATA(ld_objectid). | ||||
| "SELECT single DOCID FROM BAPISRMREC INTO @DATA(ld_documentid). | ||||
| "SELECT single DOCCLASS FROM BAPISRMREC INTO @DATA(ld_documentclass). | ||||
| "SELECT single DESCR FROM BAPISRMREC INTO @DATA(ld_description). | ||||
| "SELECT single SPSID FROM BAPISRMREC INTO @DATA(ld_model_sps_id). | ||||
| "SELECT single DOCID FROM BAPISRMREC INTO @DATA(ld_model). | ||||
| "SELECT single BOOLEAN FROM BAPISRMREC INTO @DATA(ld_documentid_check_unique). | ||||
| DATA(ld_documentid_check_unique) | = 'X'. | |||
Search for further information about these or an SAP related objects