Inserts an element in a record.Example Insertion using an anchor> * Fill SP POID table>> CLEAR element_sp_poid.> wa_element_sp_poid-NAME = 'DOC_ID'.> wa_element_sp_poid-VALUE = C_DOC_ID.> APPEND wa_element_sp_poid TO element_sp_poid.> > wa_element_sp_poid-NAME = 'VARIANT'.> wa_element_sp_poid-VALUE = '0'.> APPEND wa_element_sp_poid TO element_sp_poid.> > wa_element_sp_poid-NAME = 'VERSION'.> wa_element_sp_poid-VALUE = '0'.> APPEND wa_element_sp_poid TO element_sp_poid.> > * Fill element properties table>> CLEAR element_properties.> wa_element_properties-NAME = 'MY_PROPERTY_NAME'.> wa_element_properties-VALUE = 'MY_PROPERTY_VALUE'.> APPEND wa_ element_properties TO element_properties.> > * Call the BAPI>> CALL FUNCTION 'BAPI_RECORD_ADDELEMENT'> EXPORTING> OBJECT_ID = 'FE55793BA8182177E10000000A1148F5'> DOCUMENTCLASS = 'SRM_REC00'> SPS_ID = 'SRM_SPS_DOCUMENT'> ANCHOR = 'MY_ANCHOR'> DESCRIPTION = 'My element description'> IMPORTING> RETURN = bapi_return> TABLES> ELEMENT_SP_POID = element_sp_poid> ELEMENT_PROPERTIES = element_properties.> Insertion in a specified folder using a model node > * Fill SP POID table>> CLEAR element_sp_poid.> wa_element_sp_poid-NAME = 'DOC_ID'.> wa_element_sp_poid-VALUE = C_DOC_ID.> APPEND wa_element_sp_poid TO element_sp_poid.> > wa_element_sp_poid-NAME = 'VARIANT'.> wa_element_sp_poid-VALUE = '0'.> APPEND wa_element_sp_poid TO element_sp_poid.> > wa_element_sp_poid-NAME = 'VERSION'.> wa_element_sp_poid-VALUE = '0'.> APPEND wa_element_sp_poid TO element_sp_poid.> > * Insert by ModelId --> fill corresponding structure ofparameter >>INSERTION_BY_MODELID wa_insertion_by_modelid-MODEL_ID = '10'. ,,,,"Model ID has to exist inthe corresponding record model wa_insertion_by_modelid-PARENT_NODE_ID ='33'.,,"An existing node in therecord for example a folder > * Call the BAPI>> CALL FUNCTION 'BAPI_RECORD_ADDELEMENT'> EXPORTING> OBJECT_ID = 'FE55793BA8182177E10000000A1148F5'> DOCUMENTCLASS = 'SRM_REC00'> SPS_ID = 'SRM_SPS_DOCUMENT'> DESCRIPTION = 'My element description'> >>INSERTION_BY_MODELID = wa_insertion_by_modelid > IMPORTING> RETURN = bapi_return> TABLES> ELEMENT_SP_POID = element_sp_poid> ELEMENT_PROPERTIES = element_properties.>Notes The following requirements> must be met:
- A record has been created. OBJECTID and DOCUMENTCLASS are known.
- The record model has the status 'Released' or 'Final'
- The insertion item in the record is determined by one of the following
four parameters: ANCHOR (Insertion using an anchor) INSERTION_BY_ANCHOR (Insertion using an anchor, new, with extendedoptions) INSERTION_BY_MODELID (Insertion using a Model ID) INSERTION_BY_REFERENCE_NODE (Insertion using an existing reference nodein the record)
- 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 displaying 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 Result of the BAPI call Description Position in which the element is to be inserted in the container(anchor). Enter the name of an anchor defined in the model here. This determinesthe position at which the element is to be inserted in the container.This is the value of the attribute ANCHOR for a model node of theunderlying container. The model node must have the same element type asthe element to be inserted. If the value '*' is transferred, the element is entered in the worklistof the container. If the name of the anchor is not unique, the firstanchor with this name is used. Description Descriptive text to be displayed in the Records Browser for the elementto be inserted. Description Storage location of the container (content model) in which the elementis to be inserted. If the record is stored in WebDAV, this parametershould have an initial value. Description If the record is stored in WebDAV, the RMS and SPS (correspondingelement type of the record) need to be entered here. If not, no entry isrequired in this parameter. Description This parameter specifies whether an instance element ("I") or astructure node ("F") is to be inserted in the record. Note that theelement type must match the anchor or model node used. Default The default setting for this parameter is 'I' (instance element). Description This optional parameter allows you to insert an element using an anchor.In contrast to the parameter "anchor", you have the option here ofdefining a parent element (instance or structure node) under which theelement is then inserted as a child element. The structure of the parameter is as follows:
- ANCHOR: Here, you enter the name of the anchor defined in the record
model. The anchor determines the position at which the element is to beinserted in the record. This is the value of the attribute ANCHOR for amodel node of the underlying record model. The model node must have thesame element type as the element to be inserted.
|