SAP SCMS_DOC_READ_FILES Function Module for CMS: Retrieve Document
SCMS_DOC_READ_FILES is a standard scms doc read files SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for CMS: Retrieve Document processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for scms doc read files FM, simply by entering the name SCMS_DOC_READ_FILES into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCMS_API
Program Name: SAPLSCMS_API
Main Program: SAPLSCMS_API
Appliation area: S
Release date: 02-Nov-2001
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SCMS_DOC_READ_FILES pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'SCMS_DOC_READ_FILES'"CMS: Retrieve Document.
EXPORTING
* MANDT = SY-MANDT "Client
* P_TRANSFER_PHIO = "TIME
STOR_CAT = "Category
* CREP_ID = ' ' "Repository (Only Allowed if Category = ' ')
DOC_ID = "Document ID
* PHIO_ID = "PHIO ID if Known, May Be Shorter than DocID
PATH = "Directory Path where Retrieved Document is Located
* FRONTEND = 'X' "Retrieve Document to Front End ('X' Front End, ' ' Back End)
* SIGNATURE = 'X' "Sign URL for Access to Document ('X' Yes, ' ' No)
* NO_CACHE = ' ' "Screens, display user entry
TABLES
COMPS = "
* COMP_NAMES = "
EXCEPTIONS
BAD_STORAGE_TYPE = 1 ERROR_HIERARCHY = 10 ERROR_DOWNLOAD = 11 ERROR_OPEN = 12 ERROR_PARAMETER = 13 ERROR = 14 BAD_REQUEST = 2 UNAUTHORIZED = 3 NOT_FOUND = 4 CONFLICT = 5 INTERNAL_SERVER_ERROR = 6 ERROR_HTTP = 7 ERROR_SIGNATURE = 8 ERROR_CONFIG = 9
IMPORTING Parameters details for SCMS_DOC_READ_FILES
MANDT - Client
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
P_TRANSFER_PHIO - TIME
Data type: SDOK_CHTSTOptional: Yes
Call by Reference: Yes
STOR_CAT - Category
Data type: SDOKSTCA-STOR_CATOptional: No
Call by Reference: No ( called with pass by value option)
CREP_ID - Repository (Only Allowed if Category = SPACE)
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DOC_ID - Document ID
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
PHIO_ID - PHIO ID if Known, May Be Shorter than DocID
Data type: SDOK_PHIDOptional: Yes
Call by Reference: No ( called with pass by value option)
PATH - Directory Path where Retrieved Document is Located
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
FRONTEND - Retrieve Document to Front End ('X' Front End, SPACE Back End)
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SIGNATURE - Sign URL for Access to Document ('X' Yes, SPACE No)
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_CACHE - Screens, display user entry
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SCMS_DOC_READ_FILES
COMPS -
Data type: SCMS_DOINFOptional: No
Call by Reference: No ( called with pass by value option)
COMP_NAMES -
Data type: SCMS_DONAMOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
BAD_STORAGE_TYPE - Storage Category Not Supported
Data type:Optional: No
Call by Reference: Yes
ERROR_HIERARCHY - Error When Accessing Structures
Data type:Optional: No
Call by Reference: Yes
ERROR_DOWNLOAD -
Data type:Optional: No
Call by Reference: Yes
ERROR_OPEN -
Data type:Optional: No
Call by Reference: Yes
ERROR_PARAMETER - Parameter error
Data type:Optional: No
Call by Reference: Yes
ERROR - Unspecified error
Data type:Optional: No
Call by Reference: Yes
BAD_REQUEST - Unknown Functions or Parameters
Data type:Optional: No
Call by Reference: Yes
UNAUTHORIZED - Security Breach
Data type:Optional: No
Call by Reference: Yes
NOT_FOUND - Document/ Component/ Content Repository Not Found
Data type:Optional: No
Call by Reference: Yes
CONFLICT - Document/ Component/ Administration Data is Inaccessible
Data type:Optional: No
Call by Reference: Yes
INTERNAL_SERVER_ERROR - Internal Error in Content Server
Data type:Optional: No
Call by Reference: Yes
ERROR_HTTP - Error in HTTP Access
Data type:Optional: No
Call by Reference: Yes
ERROR_SIGNATURE - Error when Calculating Signature
Data type:Optional: No
Call by Reference: Yes
ERROR_CONFIG - Configuration error
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SCMS_DOC_READ_FILES Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_comps | TYPE STANDARD TABLE OF SCMS_DOINF, " | |||
| lv_mandt | TYPE SY-MANDT, " SY-MANDT | |||
| lv_bad_storage_type | TYPE SY, " | |||
| lv_error_hierarchy | TYPE SY, " | |||
| lv_p_transfer_phio | TYPE SDOK_CHTST, " | |||
| lv_error_download | TYPE SDOK_CHTST, " | |||
| lv_error_open | TYPE SDOK_CHTST, " | |||
| lv_error_parameter | TYPE SDOK_CHTST, " | |||
| lv_error | TYPE SDOK_CHTST, " | |||
| lv_stor_cat | TYPE SDOKSTCA-STOR_CAT, " | |||
| lt_comp_names | TYPE STANDARD TABLE OF SCMS_DONAM, " | |||
| lv_bad_request | TYPE SCMS_DONAM, " | |||
| lv_crep_id | TYPE C, " SPACE | |||
| lv_unauthorized | TYPE C, " | |||
| lv_doc_id | TYPE C, " | |||
| lv_not_found | TYPE C, " | |||
| lv_phio_id | TYPE SDOK_PHID, " | |||
| lv_conflict | TYPE SDOK_PHID, " | |||
| lv_path | TYPE C, " | |||
| lv_internal_server_error | TYPE C, " | |||
| lv_frontend | TYPE C, " 'X' | |||
| lv_error_http | TYPE C, " | |||
| lv_signature | TYPE C, " 'X' | |||
| lv_error_signature | TYPE C, " | |||
| lv_no_cache | TYPE SY-DATAR, " SPACE | |||
| lv_error_config | TYPE SY. " |
|   CALL FUNCTION 'SCMS_DOC_READ_FILES' "CMS: Retrieve Document |
| EXPORTING | ||
| MANDT | = lv_mandt | |
| P_TRANSFER_PHIO | = lv_p_transfer_phio | |
| STOR_CAT | = lv_stor_cat | |
| CREP_ID | = lv_crep_id | |
| DOC_ID | = lv_doc_id | |
| PHIO_ID | = lv_phio_id | |
| PATH | = lv_path | |
| FRONTEND | = lv_frontend | |
| SIGNATURE | = lv_signature | |
| NO_CACHE | = lv_no_cache | |
| TABLES | ||
| COMPS | = lt_comps | |
| COMP_NAMES | = lt_comp_names | |
| EXCEPTIONS | ||
| BAD_STORAGE_TYPE = 1 | ||
| ERROR_HIERARCHY = 10 | ||
| ERROR_DOWNLOAD = 11 | ||
| ERROR_OPEN = 12 | ||
| ERROR_PARAMETER = 13 | ||
| ERROR = 14 | ||
| BAD_REQUEST = 2 | ||
| UNAUTHORIZED = 3 | ||
| NOT_FOUND = 4 | ||
| CONFLICT = 5 | ||
| INTERNAL_SERVER_ERROR = 6 | ||
| ERROR_HTTP = 7 | ||
| ERROR_SIGNATURE = 8 | ||
| ERROR_CONFIG = 9 | ||
| . " SCMS_DOC_READ_FILES | ||
ABAP code using 7.40 inline data declarations to call FM SCMS_DOC_READ_FILES
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single MANDT FROM SY INTO @DATA(ld_mandt). | ||||
| DATA(ld_mandt) | = SY-MANDT. | |||
| "SELECT single STOR_CAT FROM SDOKSTCA INTO @DATA(ld_stor_cat). | ||||
| DATA(ld_crep_id) | = ' '. | |||
| DATA(ld_frontend) | = 'X'. | |||
| DATA(ld_signature) | = 'X'. | |||
| "SELECT single DATAR FROM SY INTO @DATA(ld_no_cache). | ||||
| DATA(ld_no_cache) | = ' '. | |||
Search for further information about these or an SAP related objects