SAP SCMS_DOC_READ Function Module for CMS: Read Document
SCMS_DOC_READ is a standard scms doc read 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: Read 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 FM, simply by entering the name SCMS_DOC_READ 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 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'"CMS: Read Document.
EXPORTING
* MANDT = SY-MANDT "Client
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
* SIGNATURE = 'X' "Sign URL for Access to Document ('X' Yes, ' ' No)
* SECURITY = ' ' "
* NO_CACHE = ' ' "Screens, display user entry
* RAW_MODE = ' ' "Screens, display user entry
IMPORTING
FROM_CACHE = "
CREA_TIME = "
CREA_DATE = "
CHNG_TIME = "
CHNG_DATE = "
STATUS = "CMS: Document status
DOC_PROT = "
TABLES
* ACCESS_INFO = "
* CONTENT_TXT = "
* CONTENT_BIN = "
EXCEPTIONS
BAD_STORAGE_TYPE = 1 ERROR_SIGNATURE = 10 ERROR_CONFIG = 11 ERROR_FORMAT = 12 ERROR_PARAMETER = 13 ERROR = 14 BAD_REQUEST = 2 UNAUTHORIZED = 3 COMP_NOT_FOUND = 4 NOT_FOUND = 5 FORBIDDEN = 6 CONFLICT = 7 INTERNAL_SERVER_ERROR = 8 ERROR_HTTP = 9
IMPORTING Parameters details for SCMS_DOC_READ
MANDT - Client
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
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)
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)
SECURITY -
Data type: CDefault: SPACE
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)
RAW_MODE - Screens, display user entry
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SCMS_DOC_READ
FROM_CACHE -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
CREA_TIME -
Data type: TOptional: No
Call by Reference: No ( called with pass by value option)
CREA_DATE -
Data type: DOptional: No
Call by Reference: No ( called with pass by value option)
CHNG_TIME -
Data type: TOptional: No
Call by Reference: No ( called with pass by value option)
CHNG_DATE -
Data type: DOptional: No
Call by Reference: No ( called with pass by value option)
STATUS - CMS: Document status
Data type: SCMS_DOCSTOptional: No
Call by Reference: No ( called with pass by value option)
DOC_PROT -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SCMS_DOC_READ
ACCESS_INFO -
Data type: SCMS_ACINFOptional: Yes
Call by Reference: No ( called with pass by value option)
CONTENT_TXT -
Data type: SDOKCNTASCOptional: Yes
Call by Reference: No ( called with pass by value option)
CONTENT_BIN -
Data type: SDOKCNTBINOptional: 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_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
ERROR_FORMAT - Incorrect Data Format (Structure Repository)
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
COMP_NOT_FOUND - Document/ Component/ Content Repository Not Found
Data type:Optional: No
Call by Reference: Yes
NOT_FOUND - Document/ Component/ Content Repository Not Found
Data type:Optional: No
Call by Reference: Yes
FORBIDDEN - Document or Component Already Exists
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
Copy and paste ABAP code example for SCMS_DOC_READ 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: | ||||
| lv_mandt | TYPE SY-MANDT, " SY-MANDT | |||
| lv_from_cache | TYPE C, " | |||
| lt_access_info | TYPE STANDARD TABLE OF SCMS_ACINF, " | |||
| lv_bad_storage_type | TYPE SCMS_ACINF, " | |||
| lv_error_signature | TYPE SCMS_ACINF, " | |||
| lv_error_config | TYPE SCMS_ACINF, " | |||
| lv_error_format | TYPE SCMS_ACINF, " | |||
| lv_error_parameter | TYPE SCMS_ACINF, " | |||
| lv_error | TYPE SCMS_ACINF, " | |||
| lv_stor_cat | TYPE SDOKSTCA-STOR_CAT, " | |||
| lv_crea_time | TYPE T, " | |||
| lv_bad_request | TYPE T, " | |||
| lt_content_txt | TYPE STANDARD TABLE OF SDOKCNTASC, " | |||
| lv_crep_id | TYPE C, " SPACE | |||
| lv_crea_date | TYPE D, " | |||
| lt_content_bin | TYPE STANDARD TABLE OF SDOKCNTBIN, " | |||
| lv_unauthorized | TYPE SDOKCNTBIN, " | |||
| lv_doc_id | TYPE C, " | |||
| lv_chng_time | TYPE T, " | |||
| lv_comp_not_found | TYPE T, " | |||
| lv_phio_id | TYPE SDOK_PHID, " | |||
| lv_chng_date | TYPE D, " | |||
| lv_not_found | TYPE D, " | |||
| lv_status | TYPE SCMS_DOCST, " | |||
| lv_forbidden | TYPE SCMS_DOCST, " | |||
| lv_signature | TYPE C, " 'X' | |||
| lv_conflict | TYPE C, " | |||
| lv_doc_prot | TYPE C, " | |||
| lv_security | TYPE C, " SPACE | |||
| lv_no_cache | TYPE SY-DATAR, " SPACE | |||
| lv_internal_server_error | TYPE SY, " | |||
| lv_raw_mode | TYPE SY-DATAR, " SPACE | |||
| lv_error_http | TYPE SY. " |
|   CALL FUNCTION 'SCMS_DOC_READ' "CMS: Read Document |
| EXPORTING | ||
| MANDT | = lv_mandt | |
| STOR_CAT | = lv_stor_cat | |
| CREP_ID | = lv_crep_id | |
| DOC_ID | = lv_doc_id | |
| PHIO_ID | = lv_phio_id | |
| SIGNATURE | = lv_signature | |
| SECURITY | = lv_security | |
| NO_CACHE | = lv_no_cache | |
| RAW_MODE | = lv_raw_mode | |
| IMPORTING | ||
| FROM_CACHE | = lv_from_cache | |
| CREA_TIME | = lv_crea_time | |
| CREA_DATE | = lv_crea_date | |
| CHNG_TIME | = lv_chng_time | |
| CHNG_DATE | = lv_chng_date | |
| STATUS | = lv_status | |
| DOC_PROT | = lv_doc_prot | |
| TABLES | ||
| ACCESS_INFO | = lt_access_info | |
| CONTENT_TXT | = lt_content_txt | |
| CONTENT_BIN | = lt_content_bin | |
| EXCEPTIONS | ||
| BAD_STORAGE_TYPE = 1 | ||
| ERROR_SIGNATURE = 10 | ||
| ERROR_CONFIG = 11 | ||
| ERROR_FORMAT = 12 | ||
| ERROR_PARAMETER = 13 | ||
| ERROR = 14 | ||
| BAD_REQUEST = 2 | ||
| UNAUTHORIZED = 3 | ||
| COMP_NOT_FOUND = 4 | ||
| NOT_FOUND = 5 | ||
| FORBIDDEN = 6 | ||
| CONFLICT = 7 | ||
| INTERNAL_SERVER_ERROR = 8 | ||
| ERROR_HTTP = 9 | ||
| . " SCMS_DOC_READ | ||
ABAP code using 7.40 inline data declarations to call FM SCMS_DOC_READ
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_signature) | = 'X'. | |||
| DATA(ld_security) | = ' '. | |||
| "SELECT single DATAR FROM SY INTO @DATA(ld_no_cache). | ||||
| DATA(ld_no_cache) | = ' '. | |||
| "SELECT single DATAR FROM SY INTO @DATA(ld_raw_mode). | ||||
| DATA(ld_raw_mode) | = ' '. | |||
Search for further information about these or an SAP related objects