Ansicht
Dokumentation

BAPI_RECORD_ADDELEMENTS - Insert Multiple Elements in Record

BAPI_RECORD_ADDELEMENTS - Insert Multiple Elements in Record

ROGBILLS - Synchronize billing plans   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

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 in the 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 element is 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 existing reference 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) 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 adding record content (authorization object S_SRMGS_CT)

Further information

Documentation for the business object type "Record"





Parameters

DOCUMENTCLASS
DOC_CONTEXT
ELEMENT_IDENTIFICATION
ELEMENT_INSERTION
ELEMENT_INSERTION_BY_ANCHOR
ELEMENT_INSERTION_BY_MODELID
ELEMENT_INSERTION_BY_REF_NODE
ELEMENT_PROPERTIES
ELEMENT_VISIBILITY
OBJECTID
OMIT_AUTHORITY_CHECK
RETURN
SET_ELEM_DESCR_HARD
SKIP_ELEMS_WITH_ERROR
STACKED
STORE_AS_NEW_VERSION

Exceptions

Function Group

SRM_BAPI_RECORD

Addresses (Business Address Services)   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 9110 Date: 20240523 Time: 174829     sap01-206 ( 65 ms )