SAP SCMS_DOC_CREATE Function Module for CMS: Create Document









SCMS_DOC_CREATE is a standard scms doc create 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: Create 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 create FM, simply by entering the name SCMS_DOC_CREATE 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_CREATE 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_CREATE'"CMS: Create Document
EXPORTING
* MANDT = SY-MANDT "Client
* VSCAN_PROFILE = '/SCMS/KPRO_CREATE' "Virus Scan Profile
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
* DOC_PROT = 'rud' "Protection
* SIGNATURE = 'X' "
* SECURITY = ' ' "
* OVERWRITE = ' ' "Overwrite ('X' Without Log, ' ' with Log, '-' Never)

IMPORTING
DOC_ID_OUT = "Target Document ID (if not specified, a new GUID is used)

TABLES
ACCESS_INFO = "
* CONTENT_TXT = "
* CONTENT_BIN = "

EXCEPTIONS
BAD_STORAGE_TYPE = 1 ERROR_HIERARCHY = 10 ERROR_FORMAT = 11 ERROR_PARAMETER = 12 ERROR = 13 BLOCKED_BY_POLICY = 14 BAD_REQUEST = 2 UNAUTHORIZED = 3 FORBIDDEN = 4 CONFLICT = 5 INTERNAL_SERVER_ERROR = 6 ERROR_HTTP = 7 ERROR_SIGNATURE = 8 ERROR_CONFIG = 9
.



IMPORTING Parameters details for SCMS_DOC_CREATE

MANDT - Client

Data type: SY-MANDT
Default: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

VSCAN_PROFILE - Virus Scan Profile

Data type: VSCAN_PROFILE
Default: '/SCMS/KPRO_CREATE'
Optional: Yes
Call by Reference: No ( called with pass by value option)

STOR_CAT - Category

Data type: SDOKSTCA-STOR_CAT
Optional: No
Call by Reference: No ( called with pass by value option)

CREP_ID - Repository (Only Allowed if Category = SPACE)

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DOC_ID - Document ID

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PHIO_ID - PHIO ID if Known, May Be Shorter than DocID

Data type: SDOK_PHID
Optional: Yes
Call by Reference: No ( called with pass by value option)

DOC_PROT - Protection

Data type: C
Default: 'rud'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SIGNATURE -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SECURITY -

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

OVERWRITE - Overwrite ('X' Without Log, ' ' with Log, '-' Never)

Data type: C
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SCMS_DOC_CREATE

DOC_ID_OUT - Target Document ID (if not specified, a new GUID is used)

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SCMS_DOC_CREATE

ACCESS_INFO -

Data type: SCMS_ACINF
Optional: No
Call by Reference: No ( called with pass by value option)

CONTENT_TXT -

Data type: SDOKCNTASC
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTENT_BIN -

Data type: SDOKCNTBIN
Optional: 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_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

BLOCKED_BY_POLICY -

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

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

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_CREATE 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_doc_id_out  TYPE C, "   
lt_access_info  TYPE STANDARD TABLE OF SCMS_ACINF, "   
lv_bad_storage_type  TYPE SCMS_ACINF, "   
lv_vscan_profile  TYPE VSCAN_PROFILE, "   '/SCMS/KPRO_CREATE'
lv_error_hierarchy  TYPE VSCAN_PROFILE, "   
lv_error_format  TYPE VSCAN_PROFILE, "   
lv_error_parameter  TYPE VSCAN_PROFILE, "   
lv_error  TYPE VSCAN_PROFILE, "   
lv_blocked_by_policy  TYPE VSCAN_PROFILE, "   
lv_stor_cat  TYPE SDOKSTCA-STOR_CAT, "   
lv_bad_request  TYPE SDOKSTCA, "   
lt_content_txt  TYPE STANDARD TABLE OF SDOKCNTASC, "   
lv_crep_id  TYPE C, "   SPACE
lt_content_bin  TYPE STANDARD TABLE OF SDOKCNTBIN, "   
lv_unauthorized  TYPE SDOKCNTBIN, "   
lv_doc_id  TYPE C, "   SPACE
lv_forbidden  TYPE C, "   
lv_phio_id  TYPE SDOK_PHID, "   
lv_conflict  TYPE SDOK_PHID, "   
lv_doc_prot  TYPE C, "   'rud'
lv_internal_server_error  TYPE C, "   
lv_signature  TYPE C, "   'X'
lv_error_http  TYPE C, "   
lv_security  TYPE C, "   SPACE
lv_error_signature  TYPE C, "   
lv_overwrite  TYPE C, "   ' '
lv_error_config  TYPE C. "   

  CALL FUNCTION 'SCMS_DOC_CREATE'  "CMS: Create Document
    EXPORTING
         MANDT = lv_mandt
         VSCAN_PROFILE = lv_vscan_profile
         STOR_CAT = lv_stor_cat
         CREP_ID = lv_crep_id
         DOC_ID = lv_doc_id
         PHIO_ID = lv_phio_id
         DOC_PROT = lv_doc_prot
         SIGNATURE = lv_signature
         SECURITY = lv_security
         OVERWRITE = lv_overwrite
    IMPORTING
         DOC_ID_OUT = lv_doc_id_out
    TABLES
         ACCESS_INFO = lt_access_info
         CONTENT_TXT = lt_content_txt
         CONTENT_BIN = lt_content_bin
    EXCEPTIONS
        BAD_STORAGE_TYPE = 1
        ERROR_HIERARCHY = 10
        ERROR_FORMAT = 11
        ERROR_PARAMETER = 12
        ERROR = 13
        BLOCKED_BY_POLICY = 14
        BAD_REQUEST = 2
        UNAUTHORIZED = 3
        FORBIDDEN = 4
        CONFLICT = 5
        INTERNAL_SERVER_ERROR = 6
        ERROR_HTTP = 7
        ERROR_SIGNATURE = 8
        ERROR_CONFIG = 9
. " SCMS_DOC_CREATE




ABAP code using 7.40 inline data declarations to call FM SCMS_DOC_CREATE

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.
 
 
 
 
DATA(ld_vscan_profile) = '/SCMS/KPRO_CREATE'.
 
 
 
 
 
 
"SELECT single STOR_CAT FROM SDOKSTCA INTO @DATA(ld_stor_cat).
 
 
 
DATA(ld_crep_id) = ' '.
 
 
 
DATA(ld_doc_id) = ' '.
 
 
 
 
DATA(ld_doc_prot) = 'rud'.
 
 
DATA(ld_signature) = 'X'.
 
 
DATA(ld_security) = ' '.
 
 
DATA(ld_overwrite) = ' '.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!