SAP Function Modules

C14S_DOCUMENT_CHANGE SAP Function module







C14S_DOCUMENT_CHANGE 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 C14S_DOCUMENT_CHANGE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: C14S
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM C14S_DOCUMENT_CHANGE - C14S DOCUMENT CHANGE





CALL FUNCTION 'C14S_DOCUMENT_CHANGE' "
  EXPORTING
    i_doccat =                  " draw-dokar
    i_docno =                   " draw-doknr
*   i_partdoc = '000'           " draw-doktl
*   i_version = '00'            " draw-dokvr
*   i_langu = SY-LANGU          " sy-langu
    i_doktext =                 " drat-dktxt
    i_reqreason =               " c
    i_valdat =                  " estrh-valfr
*   i_user = SY-UNAME           " drap-prnam
* TABLES
*   e_exterror_tab =            " espap_exterror_tab_type  Error Message Table
  EXCEPTIONS
    DOCCAT_NEEDED = 1           "
    DOCUMENT_NOT_EXISTS = 2     "
    DOCNO_NEEDED = 3            "
    CHANGE_FAILED = 4           "
    .  "  C14S_DOCUMENT_CHANGE

ABAP code example for Function Module C14S_DOCUMENT_CHANGE





The ABAP code below is a full code listing to execute function module C14S_DOCUMENT_CHANGE 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:
it_e_exterror_tab  TYPE STANDARD TABLE OF ESPAP_EXTERROR_TAB_TYPE,"TABLES PARAM
wa_e_exterror_tab  LIKE LINE OF it_e_exterror_tab .


SELECT single DOKAR
FROM DRAW
INTO @DATA(ld_i_doccat).


SELECT single DOKNR
FROM DRAW
INTO @DATA(ld_i_docno).


SELECT single DOKTL
FROM DRAW
INTO @DATA(ld_i_partdoc).


SELECT single DOKVR
FROM DRAW
INTO @DATA(ld_i_version).

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

SELECT single DKTXT
FROM DRAT
INTO @DATA(ld_i_doktext).

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

SELECT single VALFR
FROM ESTRH
INTO @DATA(ld_i_valdat).


SELECT single PRNAM
FROM DRAP
INTO @DATA(ld_i_user).


"populate fields of struture and append to itab
append wa_e_exterror_tab to it_e_exterror_tab. . CALL FUNCTION 'C14S_DOCUMENT_CHANGE' EXPORTING i_doccat = ld_i_doccat i_docno = ld_i_docno * i_partdoc = ld_i_partdoc * i_version = ld_i_version * i_langu = ld_i_langu i_doktext = ld_i_doktext i_reqreason = ld_i_reqreason i_valdat = ld_i_valdat * i_user = ld_i_user * TABLES * e_exterror_tab = it_e_exterror_tab EXCEPTIONS DOCCAT_NEEDED = 1 DOCUMENT_NOT_EXISTS = 2 DOCNO_NEEDED = 3 CHANGE_FAILED = 4 . " C14S_DOCUMENT_CHANGE
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 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_i_doccat  TYPE DRAW-DOKAR ,
it_e_exterror_tab  TYPE STANDARD TABLE OF ESPAP_EXTERROR_TAB_TYPE ,
wa_e_exterror_tab  LIKE LINE OF it_e_exterror_tab,
ld_i_docno  TYPE DRAW-DOKNR ,
ld_i_partdoc  TYPE DRAW-DOKTL ,
ld_i_version  TYPE DRAW-DOKVR ,
ld_i_langu  TYPE SY-LANGU ,
ld_i_doktext  TYPE DRAT-DKTXT ,
ld_i_reqreason  TYPE C ,
ld_i_valdat  TYPE ESTRH-VALFR ,
ld_i_user  TYPE DRAP-PRNAM .


SELECT single DOKAR
FROM DRAW
INTO ld_i_doccat.


"populate fields of struture and append to itab
append wa_e_exterror_tab to it_e_exterror_tab.

SELECT single DOKNR
FROM DRAW
INTO ld_i_docno.


SELECT single DOKTL
FROM DRAW
INTO ld_i_partdoc.


SELECT single DOKVR
FROM DRAW
INTO ld_i_version.

ld_i_langu = 'Check type of data required'.

SELECT single DKTXT
FROM DRAT
INTO ld_i_doktext.

ld_i_reqreason = 'Check type of data required'.

SELECT single VALFR
FROM ESTRH
INTO ld_i_valdat.


SELECT single PRNAM
FROM DRAP
INTO ld_i_user.

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 C14S_DOCUMENT_CHANGE or its description.