SAP Function SRM_DOCUMENT_CHECKOUT_VIA_TAB - SRM: Get Document Content by Specifying Tables

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': Do Commit
OBJECTID BAPISRMDOC-GUID C 32 Internal Document ID
VARIANT BAPISRMDOC-VARIANT I 4 0 X Variant Number
VERSION BAPISRMDOC-VERSION I 4 0 X Physical Version Number
X_SET_CHECKED_OUT BAPISRMDOC-BOOLEAN C 1 X 'X': Set Check-Out Lock

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameter

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

Functionality
The function module SRM_DOCUMENT_CHECKOUT_VIA_TAB gets the documentcontent from the Records Management back end for the client application.
You can use the binary_flag field of the structure BAPIDOCCOMP to decidewhether the content of a component is retrieved from the ASCIItable ASCII_CONTENT (binary_flag <> 'X') or from the binary tableBIN_CONTENT (binary_flag = 'X'). Using the component size and the rowlength of BIN_CONTENT or ASCII_CONTENT (calculated in bytes), you cancalculate the offset at which a component in the internal table beginsand ends. A new component always begins with a new line.

Example
CALL FUNCTION 'SRM_DOCUMENT_CHECKOUT_VIA_TAB'
EXPORTING
objectid = objectid
documentclass = documentclass
* version = version " version = 0 variant = 0 stands for thecurrent version
* variant = variant
IMPORTING
return = return
TABLES
components = components
ascii_content = ascii_content
bin_content = bin_content
.