SAP Function Modules

SCMS_DOC_COPY SAP Function module - CMS: Copy Document







SCMS_DOC_COPY is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SCMS_DOC_COPY into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SCMS_API
Released Date: 02.11.2001
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SCMS_DOC_COPY - SCMS DOC COPY





CALL FUNCTION 'SCMS_DOC_COPY' "CMS: Copy Document
  EXPORTING
*   src_mandt = SY-MANDT        " sy-mandt      Source client
    src_stor_cat =              " sdokstca-stor_cat  Source Category
*   src_crep_id = SPACE         " c             Source Repository (Only Allowed if Category = SPACE)
    src_doc_id =                " c             Source Document ID
*   src_phio_id =               " sdok_phid     PHIO ID if Known, May Be Shorter than DocID
*   src_signature = 'X'         " c             Sign URL for Access to Source Document ("X" Yes, SPACE No)
*   dst_mandt = SY-MANDT        " sy-mandt      Target Client
*   dst_stor_cat = SPACE        " sdokstca-stor_cat  Target Category
*   dst_crep_id = SPACE         " c             Target Repository (Only Allowed if Category = SPACE)
*   dst_doc_id = SPACE          " c             Target Document ID
*   dst_phio_id =               " sdok_phid     PHIO ID if Known, May Be Shorter than DocID
*   dst_doc_prot = 'rud'        " c             Security Level of Target Object
*   security = SPACE            " c
*   overwrite = ' '             " c             Overwrite ("X" Without Log, " " with Log, "-" Never)
*   vscan_profile = '/SCMS/KPRO_CREATE'  " vscan_profile  Virus Scan Profile
  IMPORTING
    doc_id_out =                " c             Target Document ID (if not specified, a new GUID is used)
* TABLES
*   mod_compinfo =              " scms_mod_acinf  SCMS:  Details of New Document Contents in Internal Table
  EXCEPTIONS
    BAD_STORAGE_TYPE = 1        "               Storage Category Not Supported
    BAD_REQUEST = 2             "               Unknown Functions or Parameters
    UNAUTHORIZED = 3            "               Security Breach
    NOT_FOUND = 4               "               Document/ Component/ Content Repository Not Found
    FORBIDDEN = 5               "               Document or Component Already Exists
    CONFLICT = 6                "               Document/ Component/ Administration Data is Inaccessible
    INTERNAL_SERVER_ERROR = 7   "               Internal Error in Content Server
    ERROR_HTTP = 8              "               Error in HTTP Access
    ERROR_SIGNATURE = 9         "               Error when Calculating Signature
    ERROR_CONFIG = 10           "               Configuration error
    ERROR_FORMAT = 11           "               Incorrect Data Format (Structure Repository)
    ERROR_PARAMETER = 12        "               Parameter error
    ERROR = 13                  "               Unspecified error
    BLOCKED_BY_POLICY = 14      "
    .  "  SCMS_DOC_COPY

ABAP code example for Function Module SCMS_DOC_COPY





The ABAP code below is a full code listing to execute function module SCMS_DOC_COPY including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_doc_id_out  TYPE C ,
it_mod_compinfo  TYPE STANDARD TABLE OF SCMS_MOD_ACINF,"TABLES PARAM
wa_mod_compinfo  LIKE LINE OF it_mod_compinfo .

DATA(ld_src_mandt) = 'Check type of data required'.

SELECT single STOR_CAT
FROM SDOKSTCA
INTO @DATA(ld_src_stor_cat).

DATA(ld_src_crep_id) = 'Check type of data required'.
DATA(ld_src_doc_id) = 'Check type of data required'.
DATA(ld_src_phio_id) = 'Check type of data required'.
DATA(ld_src_signature) = 'Check type of data required'.
DATA(ld_dst_mandt) = 'Check type of data required'.

SELECT single STOR_CAT
FROM SDOKSTCA
INTO @DATA(ld_dst_stor_cat).

DATA(ld_dst_crep_id) = 'Check type of data required'.
DATA(ld_dst_doc_id) = 'Check type of data required'.
DATA(ld_dst_phio_id) = 'Check type of data required'.
DATA(ld_dst_doc_prot) = 'Check type of data required'.
DATA(ld_security) = 'Check type of data required'.
DATA(ld_overwrite) = 'Check type of data required'.
DATA(ld_vscan_profile) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_mod_compinfo to it_mod_compinfo. . CALL FUNCTION 'SCMS_DOC_COPY' EXPORTING * src_mandt = ld_src_mandt src_stor_cat = ld_src_stor_cat * src_crep_id = ld_src_crep_id src_doc_id = ld_src_doc_id * src_phio_id = ld_src_phio_id * src_signature = ld_src_signature * dst_mandt = ld_dst_mandt * dst_stor_cat = ld_dst_stor_cat * dst_crep_id = ld_dst_crep_id * dst_doc_id = ld_dst_doc_id * dst_phio_id = ld_dst_phio_id * dst_doc_prot = ld_dst_doc_prot * security = ld_security * overwrite = ld_overwrite * vscan_profile = ld_vscan_profile IMPORTING doc_id_out = ld_doc_id_out * TABLES * mod_compinfo = it_mod_compinfo EXCEPTIONS BAD_STORAGE_TYPE = 1 BAD_REQUEST = 2 UNAUTHORIZED = 3 NOT_FOUND = 4 FORBIDDEN = 5 CONFLICT = 6 INTERNAL_SERVER_ERROR = 7 ERROR_HTTP = 8 ERROR_SIGNATURE = 9 ERROR_CONFIG = 10 ERROR_FORMAT = 11 ERROR_PARAMETER = 12 ERROR = 13 BLOCKED_BY_POLICY = 14 . " SCMS_DOC_COPY
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 13. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 14. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_doc_id_out  TYPE C ,
ld_src_mandt  TYPE SY-MANDT ,
it_mod_compinfo  TYPE STANDARD TABLE OF SCMS_MOD_ACINF ,
wa_mod_compinfo  LIKE LINE OF it_mod_compinfo,
ld_src_stor_cat  TYPE SDOKSTCA-STOR_CAT ,
ld_src_crep_id  TYPE C ,
ld_src_doc_id  TYPE C ,
ld_src_phio_id  TYPE SDOK_PHID ,
ld_src_signature  TYPE C ,
ld_dst_mandt  TYPE SY-MANDT ,
ld_dst_stor_cat  TYPE SDOKSTCA-STOR_CAT ,
ld_dst_crep_id  TYPE C ,
ld_dst_doc_id  TYPE C ,
ld_dst_phio_id  TYPE SDOK_PHID ,
ld_dst_doc_prot  TYPE C ,
ld_security  TYPE C ,
ld_overwrite  TYPE C ,
ld_vscan_profile  TYPE VSCAN_PROFILE .

ld_src_mandt = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_mod_compinfo to it_mod_compinfo.

SELECT single STOR_CAT
FROM SDOKSTCA
INTO ld_src_stor_cat.

ld_src_crep_id = 'Check type of data required'.
ld_src_doc_id = 'Check type of data required'.
ld_src_phio_id = 'Check type of data required'.
ld_src_signature = 'Check type of data required'.
ld_dst_mandt = 'Check type of data required'.

SELECT single STOR_CAT
FROM SDOKSTCA
INTO ld_dst_stor_cat.

ld_dst_crep_id = 'Check type of data required'.
ld_dst_doc_id = 'Check type of data required'.
ld_dst_phio_id = 'Check type of data required'.
ld_dst_doc_prot = 'Check type of data required'.
ld_security = 'Check type of data required'.
ld_overwrite = 'Check type of data required'.
ld_vscan_profile = 'Check type of data required'.

SAP Documentation for FM SCMS_DOC_COPY


Copy document

EXAMPLE ...See here for full SAP fm documentation









Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SCMS_DOC_COPY or its description.