SAP Function SRM_DOCUMENT_CHECKOUT_VIA_FILE - SRM: Get Document Content with File Transfer

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
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 Boolean

Parameter Reference Type Length Text
RETURN BAPIRET2 u 548 Return Parameter

Parameter Reference Length Optional Text
FILE_TAB BAPIDOCFILES 904 Table of Document Files

Exception Text
DOC_NOT_FOUND Document Not Found
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization
PARAMETER_ERROR Parameter error

Functionality
Downloads the document to the desktop in local files
In most cases, a document consists of a single file. If there is morethan one file, you can use the function moduleSRM_DOCUMENT_GET_COMP_INFO to determine the components of the document.

Example
DATA:
objectid TYPE bapisrmdoc-guid,
documentclass TYPE bapisrmdoc-docclass,
wa_file TYPE bapidocfiles,
lt_file TYPE TABLE OF bapidocfiles.
wa_comp TYPE bapidoccomp,
lt_comp TYPE TABLE of lt_comp.
...
wa_file-comp_id = 'my.txt'.
wa_file-directory = 'c:\temp\'.
wa_file-filename = 'my.txt'.
append wa_file to lt_file.
**********************************************************************
* if document has more than one file
CALL FUNCTION 'SRM_DOCUMENT_GET_COMP_INFO'
EXPORTING
objectid = objectid
documentclass = documentclass
TABLES
component_info = lt_comp
.
LOOP AT lt_comp INTO wa_comp.
,,wa_file-comp_id = wa_comp-comp_id.
wa_file-directory = 'c:\temp'.
wa_file-filename = wa_comp-comp_id.
APPEND wa_file to lt_file.
ENDLOOP.
**********************************************************
CALL FUNCTION 'SRM_DOCUMENT_CHECKOUT_VIA_FILE'
EXPORTING
objectid = objectid
documentclass = documentclass
* IMPORTING
* return = return
TABLES
file_tab = lt_file
.
*