Fonction SAP BAPI_RECORD_CREATE - Create Record

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DESCRIPTION BAPISRMREC-DESCR C 255 Description, Does Not Have To Be Unique
DOCUMENTID BAPISRMREC-DOCID C 255 Unique ID for New Record (Record Number)
DOCUMENTID_CHECK_UNIQUE BAPISRMREC-BOOLEAN C 1 'X' X Check Uniqueness of the Name for the Record to be Created
MODEL BAPISRMREC-DOCID C 255 Unique ID of Record Model
MODEL_SPS_ID BAPISRMREC-SPSID C 32 Element Type of Record Model
RMS_ID BAPISRMREC-RMSID C 32 Records Management System ID
SPS_ID BAPISRMREC-SPSID C 32 Element Type for Record to be Created

Paramètre Reférence Type Long. Description
DOCUMENTCLASS BAPISRMREC-DOCCLASS C 10 Storage Location of New Record (Content Model)
OBJECTID BAPISRMREC-GUID C 32 Internal ID of New Record
RETURN BAPIRET2 u 548 Return Code

Functionality
This BAPI is used for creating a new record.
The record is created from the specified record model, in the specifiedRecords Management System, with the specified element type.
In the parameter DocumentId, enter a unique identification for therecord (record number). The description entered in the parameters doesnot have to be unique.

Example
CALL FUNCTION 'BAPI_RECORD_CREATE'
     EXPORTING
          rms_id        = 'RMS_TEST'
          sps_id        = 'SPS_REC_TEST'
          documentid    = '007-4711'
          description   = 'Test for FBS BAPI_RECORD_CREATE'

model_sps_id = 'SPS_MOD_TEST'
model = 'Record model for BAPI test'

IMPORTING
          return        = return
objectid = objid
documentclass = docclass.

Notes
The following prerequisites must be met before the BAPI can beimplemented:

  • An element type is created in the service provider for record models.

  • (The service provider supplied for record models is SRM_SP_MODEL.)
    • An element type is created in the service provider for records.

    • (The service provider supplied for records is SRM_SP_RECORDS.)
      • The element types for records and record models are assigned to the
      • Records Management System (RMS) specified in the call.
        • The record model on which the record is to be based already exists.

        • The model must have status Released or Final.

        • The following authorizations are required:
          • Authorization for displaying properties of the record model
          • (authorization object S_SRMGS_PR)
            • Authorization for creating records (authorization object S_SRMGS_DC)

            • Authorization for creating versions/variants of records (authorization
            • object S_SRMGS_VV)
              • Authorization for changing record properties (authorization object
              • S_SRMGS_PR)
                • Authorization for displaying record properties (authorization object
                • S_SRMGS_PR)
                  • Authorization for creating record content (authorization object
                  • S_SRMGS_CT)

                    Further information
                    For more information on creating element types, see the SAP Libraryunder SAP Web Application Server -> Basis Services -> RecordsManagement -> Standard Service Providers -> Generic Service Provider
                    or choose the following in the Implementation Guide (IMG): SAP WebApplication Server -> Basis Services -> Records Management -> MaintainElement Types.

                    Description
                    Storage location of the new record (content model)

                    Description
                    Internal ID of new record

                    Description
                    Result of the BAPI call

                    Description
                    Description text for the record to be created.
                    Unlike the document ID, this does not have to be unique.

                    Description
                    Unique ID of the record to be created (record number)

                    Description
                    Checks whether the description (record number) of the record beingcreated is unique, i.e. that the record number is not already being usedfor an existing record.

                    Default
                    Uniqueness is checked.

                    Description
                    Unique identifier of the record model that the record is based on.
                    To find the unique identifier of a record model, proceed as follows:

                    • Select the record model in the Records Organizer, and then choose
                    • "Display".
                      • The record model is opened in the Modeler. Choose "Model attributes".

                      • The "unique identifier" of the model is now displayed in the list of
                      • attributes.

                        Description
                        Element type from the record model that the record is to be based on.

                        Description
                        ID of the Records Management Systems (RMS) in which the record is to becreated

                        Description
                        Element type for the record to be created