SAP Function SRM_DOCUMENT_CHANGEPROPERTIES - SRM: Set Document Attributes

Parameter Reference Type Length Default Optional Text
DOCUMENTCLASS BAPISRMDOC-DOCCLASS C 10 Location of Document
DOC_CONTEXT BAPIDOCCONTEXT u 64 X Access Context: RMS ID and SPS ID
DO_COMMIT BAPISRMDOC-BOOLEAN C 1 X 'X': Commit after Changing Attribute
OBJECTID BAPISRMDOC-GUID C 32 Internal Document ID
WHOLE_DOCUMENT BAPISRMDOC-BOOLEAN C 1 '' X On whole document 'X' or only on one entry 'Y'

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameter

Parameter Reference Length Optional Text
PROPERTIES BAPIPROPTB 319 Properties to Set
PROPS_DELETE BAPIPROPTB 319 X Properties to Delete

Exception Text
DOC_NOT_FOUND Document Not Found
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization
PARAMETER_ERROR Parameter error
VARIANT_NOT_FOUND Variant not found
VERSION_NOT_FOUND Version Not Found
YET_LOCKED Document locked by other user

Functionality
Set, change, or delete the attribute values of a document.
You can use this function to change particular attribute values of adocument. Attribute values that are not specified remain the same.
For attributes that can have more than one value (for example, keywords), the specified values are added. Old values are not deleted.

Example
* Add new keyword 'BAPI' to a document
wa_properties-NAME  = 'SRM_KEYWORD'.
wa_properties-VALUE = 'BAPI'.
APPEND wa_properties TO lt_properties.
* delete keyword of value 'Test'
wa_properties-NAME  = 'SRM_KEYWORD'.
wa_properties-VALUE = 'Test'.
APPEND wa_properties TO props_delete.
CALL FUNCTION 'SRM_DOCUMENT_CHANGEPROPERTIES'
  EXPORTING
    OBJECTID            = 'FE55793BA8182177E10000000A1148F5'
    DOCUMENTCLASS       = 'SRM_DOC04'
    WHOLE_DOCUMENT      = ' '
  IMPORTING
    RETURN              = bapi_return
  TABLES
PROPERTIES = lt_properties    
PROPS_DELETE = props_delete.

Notes
Some attributes are defined for the whole document and are valid for allversions. Some attributes are defined exclusively for a specific versionand are only valid for that version. If you want to set attribute valuesfor the whole document, you must set the import parameter to 'X'.