Functionality Inserts multiple elements in a record. Example * Fill SP POID table>> CLEAR element_identification.> > * SP POID 1. element (Service Provider for Documents)>> wa_element_identification-ELEM_NO = 1.> * "%" is used to distinguish the SPS_ID from other POID parameters.> wa_element_identification-NAME = '%SPS_ID%'. > wa_element_identification-VALUE = 'SRM_SPS_DOCUMENT'.> APPEND wa_element_identification TO element_identification.> > wa_element_identification-NAME = 'DOC_ID'.> wa_element_identification-VALUE = C_DOC_ID.> APPEND wa_element_identification TO element_identification.> > wa_element_identification-NAME = 'VARIANT'.> wa_element_identification-VALUE = '0'.> APPEND wa_elem_identification TO element_identification.> > wa_element_identification-NAME = 'VERSION'.> wa_element_identification-VALUE = '0'.> APPEND wa_element_identification TO element_identification.> > * SP POID 2. element (Service Provider for Transactions)>> wa_element_identification-ELEM_NO = 2.> > wa_element_identification-NAME = '%SPS_ID%'.> wa_element_identification-VALUE = '>SRM_SPS_GENERAL_TRANSACTION '.> APPEND wa_element_identification TO element_identification.> > wa_element_identification-NAME = 'TCODE'.> wa_element_identification-VALUE = ''.> APPEND wa_element_identification TO element_identification.> > *** Fill element insertion table>> *Insertion by Anchor>> CLEAR element_insertion.> wa_element_insertion-ELEM_NO = 1.> wa_element_insertion-ANCHOR = 'MY_DOC_ANCHOR'.> wa_element_insertion-DESCR = 'My document description'.> APPEND wa_element_insertion TO element_insertion.> > *Insertion by ModelId> wa_element_insertion_modelid-ELEM_NO = 2.> wa_element_insertion_modelid-MODEL_ID = '10'. "an existing node inthe record model> wa_element_insertion_modelid-DESCR = 'My transaction description'. > APPEND wa_element_insertion_modelid TO element_insertion_modelid.> > * Fill element properties table>> CLEAR element_properties.> wa_element_properties-ELEM_NO = 1.> wa_element_properties-NAME = 'MY_DOC_PROPERTY_NAME'.> wa_element_properties-VALUE = 'MY_DOC_PROPERTY_VALUE'.> APPEND wa_ element_properties TO element_properties.> > * Call the BAPI>> CALL FUNCTION 'BAPI_RECORD_ADDELEMENTS'> EXPORTING> OBJECT_ID,,,,,,,,,,= 'FE55793BA8182177E10000000A1148F5'> DOCUMENTCLASS ,, ,,= 'SRM_REC00'> SKIP_ELEMS_WITH_ERROR ,,= 'X'> TABLES> ELEMENT_IDENTIFICATION,,,,= element_identification> ELEMENT_INSERTION ,,= element_insertion> ELEMENT_PROPERTIES ,,= element_properties> RETURN ,,= bapi_return_tab> ELEMENT_INSERTION_BY_MODELID,,= element_insertion_modelid.>Notes The following requirements> must be met:
- A record has been created. OBJECTID and DOCUMENTCLASS are known.
- The insertion position in the record is defined for each element by one
of the table parameters listed below. You must ensure that each elementis listed in only one of these tables: ELEMENT_INSERTION (to insert the element using an anchor) ELEMENT_INSERTION_BY_ANCHOR (to insert the element using an anchor, new,with added options) ELEMENT_INSERTION_BY_MODELID (to insert the element using a model ID) ELEMENT_INSERTION_BY_REF_NODE (to insert the element using an existingreference node in the record)
- The record model has the status 'Released' or 'Final'
- Insertion of elements that are stored in the WebDAV repository, and
whose underlying URL (-> documentation on Records Management) exceeds128 Bytes, is not supported.> The following authorizations> are required:
- Authorization for displaying record content (authorization object
S_SRMGS_CT)
- Authorization for displaying record properties (authorization object
S_SRMGS_PR)
- Authorization for displaying record models (authorization object
S_SRMGS_CT)
- Authorization for displaying properties of the record model
(authorization object S_SRMGS_PR)
- Authorization for creating versions/variants of records (authorization
object S_SRMGS_VV)
- Authorization for changing record properties (authorization object
S_SRMGS_PR)
- Authorization for adding record content (authorization object
S_SRMGS_CT)Further information Documentation for the business object type "Record" Description Location of the record (content model) in which you want to insert theelements. If the record is in the WebDAV, give this parameter an initialvalue. Description If the record is stored in the WebDAV, you must specify the RMS and SPS(corresponding element type of the record) here. Otherwise, you do notneed to set this parameter. Description Internal ID of the record in which the elements are to be inserted Description This parameter determines whether the authority check will be performed. Default The authority check will be performed. Description This parameter determines whether the DESCRIPTION can be overwritten bythe corresponding service provider's description. Description If this indicator is selected, elements with errors are ignored. Otherwise, processing is terminated at the first error. Description This parameter specifies whether the element is inserted at the start("X") or at the end (" ") of the model ID. Default By default, the element is inserted at the start of the model ID. Description If the indicator is set, a new logical version is created for a record. If it is not, no new logical record version is created. If you want to create a new logical version without inserting elementsinto the record, enter 'X' in the parameter STORE_AS_NEW_VERSION, andtransfer an empty table for the parameter ELEMENT_IDENTIFICATION. Description This table is used to transfer all information for the uniqueidentification of the elements to be inserted in a record. The table has three columns:
- Sequence number of the element to insert.
All elements to be inserted are assigned consecutive element numbers.These are used when determining which table entries are associated withwhich elements.
- Parameter Name
- Parameter Value
The columns parameter> name and parameter value> transfername-value pairs for parameters that uniquely identify the element to beinserted. In one row, first enter the element type> of the element beinginserted (for instance elements) or a constant (for structure nodes). Ifthe element is an instance element, you need to add further rows todescribe the SP POID of the element (see b) ):a) Element is a structure node ELEM_NO,,NAME,,VALUE Seq. no. of element ,,%FOLDER% ,,b) Element is an instance element ELEM_NO,,NAME,,VALUE Seq. no. of the element to be inserted ,,%SPS_ID%> ,,
Then enter the SP POID>. This is the information that allows the"responsible" service provider to uniquely identify an element. Which information a service provider needs to identify elements isdetailed in the SAP Records Registry (transaction SRMREGEDIT). If youdouble-click a service provider, its "SP POID Parameters" are displayedon a tab page with the same name. Enter the parameters specified here and the corresponding values for theelement, along with the sequence number, in the tableELEMENT_IDENTIFICATION. Example> for the service provider for documents (SRM_SP_DOCUMENT): ELEM_NO,,NAME,,VALUE Seq. no. of the element to be inserted ,,%SPS_ID%> ,,,,,,for example, SRM_SPS_DOCUMENT_DEMO> Seq. no. of the element to be inserted ,,DOC_ID,,
Seq. no. of the element to be inserted,,VARIANT,, Seq. no. of the element to be inserted,,VERSION,, Example> for the service provider for transactions(SRM_SP_GENERAL_TRANSACTION): ELEM_NO,,NAME,,VALUE Seq. no. of the element to be inserted ,,%SPS_ID%> ,,,,,,for example, SRM_SPS_GENERAL_URL_DEMO> Seq. no. of the element to be inserted ,,TCODE,,
Important>: Currently, only a restricted check is performed on the SP POID. It istherefore possible that errors and inconsistencies in elementidentification are sometimes not recognized, and do not result in anerror message. Insertion of elements that are stored in the WebDAV repository, aswell as their basic URL (-> documentation on Records Management) > 128Bytes, is not supported.>Description This table is used to transfer information about how the elements areto be inserted in the record. The table has three columns:
- Sequence number of the element to insert.
All elements to be inserted are assigned consecutive element numbers.These are used when determining which table entries are associatedwith which elements.
- Anchor
Enter the value of the anchor defined for the element in the recordmodel (attribute ANCHOR). The anchor determines the position in therecord at which the element is to be inserted. The model node must bein the record model on which the particular model is based. Enter thevalue of the attribute ANCHOR for the model node that represents theelement type of the element. If the value '*' is transferred, the element is entered in the Historyof the record. If the name of the anchor is not unique, the firstanchor with this name is used.
- Description
Here you can enter a descriptive text, which is displayed in the recordwhen the element is displayed.Description This table is used to transfer information about how the elements are tobe inserted in the record using the anchor. In contrast to theELEMENT_INSERTION table, you have the added option of specifying anexisting record element in the record. If you do this, the element beinginserted will be a child of this record element. The table contains the following columns:
- ELEM_NO: Sequence number of the element to insert. All elements to be
inserted are assigned consecutive element numbers. These are used whendetermining which table entries are associated with which elements.
- ANCHOR: Enter the value of the anchor defined for the element in the
record model (attribute ANCHOR). The anchor determines the position(model node) in the record at which the element is to be inserted. Themodel node must be in the record model on which the particular model isbased. Enter the value of the attribute ANCHOR for the model node thatrepresents the element type (or structure node) of the element beinginserted.
- PARENT_NODE_ID: You can use this optional parameter to define a parent
node (ELEMENT_ID) beneath which the element is inserted as a childelement.
|