SAP Function SRM_DOCUMENT_CHECKIN_VIA_TAB - SRM: Set Content by Specifying Tables

Parameter Reference Type Length Default Optional Text
AS_NEW_VERSION BAPISRMDOC-BOOLEAN C 1 X 'X': Check In as New Version
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

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameter
X_NEW_DOC_CREATED BAPISRMDOC-BOOLEAN C 1 X': Check In Content for New Document

Parameter Reference Length Optional Text
ASCII_CONTENT BAPIASCONT 1022 X ASCII Content
BIN_CONTENT BAPICONTEN 1022 X Binary Content
COMPONENTS BAPIDOCCOMP 400 Document Components

Exception Text
DOC_NOT_FOUND Document Not Found
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization
PARAMETER_ERROR Parameter error
YET_LOCKED Document locked by other user

Functionality
Transfers the document content to the Records Management by specifyingtables
Note: A new component must always start in a new row in the tableASCII_CONTENT or BIN_CONTENT, if the document consists of multiplefiles.

Example
DATA:
objectid TYPE bapisrmdoc-guid<(>,<)>
documentclass TYPE bapisrmdoc-docclass<(>,<)>
wa_comp TYPE bapidoccomp<(>,<)>
lt_comp TYPE TABLE OF bapidoccomp<(>,<)>
wa_bin TYPE bapiconten<(>,<)>
it_bin TYPE TABLE OF bapiconten<(>,<)>
wa_ascii TYPE bapiascont<(>,<)>
lt_ascii TYPE TABLE of bapiascont.
...
* ASCII content
wa_comp-comp_count = 1.
wa_comp-comp_id = 'my.txt'.
wa_comp-mimetype = 'text/plain'. "Must be lowercase
wa_comp-comp_size = filelen. "File size in bytes
wa_comp-binary_flag = ''.
wa_comp-com_num = 1.
append wa_comp to lt_comp.
wa_ascii-line = 'This is my first text'.
append wa_ascii to lt_ascii.
CALL FUNCTION 'SRM_DOCUMENT_CHECKIN_VIA_TAB'
EXPORTING
objectid = objectid
documentclass = documentclass
as_new_version = 'X' "Create new logical version
do_commit = 'X'
* IMPORTING
* return = return
TABLES
components = lt_comp
ascii_content = lt_ascii
.
* Binary content
wa_comp-comp_count = 1.
wa_comp-comp_id = 'my_ms.doc'.
wa_comp-mimetype = 'application/msword'. "Must be lowercase
wa_comp-comp_size = filelen. "File size in bytes
wa_comp-binary_flag = 'X'.
wa_comp-com_num = 1.
APPEND wa_comp TO lt_comp.
wa_bin-line = bin_line.
APPEND wa_bin TO lt_bin.
CALL FUNCTION 'SRM_DOCUMENT_CHECKIN_VIA_TAB'
EXPORTING
objectid = objectid
documentclass = documentclass
as_new_version = 'X' "Create new logical version
do_commit = 'X'
* IMPORTING
* return = return
TABLES
components = lt_comp
bin_content = lt_bin
.

Notes
The function module SRM_DOCUMENT_CHECKIN_VIA_TAB can also be used toupload documents in the batch process. For more information, see Note955523.