Ansicht
Dokumentation
SRM_RECORD_ADDELEMENT - Insert Element in Container
ROGBILLS - Synchronize billing plans Vendor Master (General Section)This documentation is copyright by SAP AG.
Functionality
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 of parameterINSERTION_BY_MODELID
wa_insertion_by_modelid-MODEL_ID = '10'. ,,,,"Model ID has to exist in the corresponding record model
wa_insertion_by_modelid-PARENT_NODE_ID ='33'.,,"An existing node in the record 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 extended options)
- INSERTION_BY_MODELID (Insertion using a Model ID)
- INSERTION_BY_REFERENCE_NODE (Insertion using an existing reference node in the record)
- Insertion of elements that are stored in the WebDAV repository, and whose underlying URL (-> documentation on Records Management) exceeds 128 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"
Parameters
ALL_SAME_NAME_ANCHORANCHOR
DESCRIPTION
DOCUMENTCLASS
DOC_CONTEXT
ELEMENT_PROPERTIES
ELEMENT_SP_POID
ELEMENT_TYPE
ELEMENT_VISIBILITY
INSERTION_BY_ANCHOR
INSERTION_BY_MODELID
INSERTION_BY_REFERENCE_NODE
OBJECTID
OMIT_AUTHORITY_CHECK
RETURN
SET_ELEM_DESCR_HARD
SPS_ID
STACKED
STORE_AS_NEW_VERSION
Exceptions
ANCHOR_NOT_FOUNDCONTAINER_IS_LOCKED
CONTAINER_NOT_FOUND
INTERNAL_ERROR
MAX_NUMBER_OF_ELEMENTS
NOT_AUTHORIZED
PARAMETER_ERROR
POID_IS_WRONG
RECORD_IS_FROZEN
Function Group
SRM_BAPI_RECORDABAP Short Reference BAL Application Log Documentation
This documentation is copyright by SAP AG.
Length: 11090 Date: 20240523 Time: 100017 sap01-206 ( 72 ms )