SAP Function Modules

FI_DOCUMENT_CHANGE SAP Function module







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

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


Pattern for FM FI_DOCUMENT_CHANGE - FI DOCUMENT CHANGE





CALL FUNCTION 'FI_DOCUMENT_CHANGE' "
* EXPORTING
*   i_awtyp =                   " acchd-awtyp
*   i_awref =                   " acchd-awref
*   i_aworg = SPACE             " acchd-aworg
*   i_awsys = SPACE             " acchd-awsys
*   i_kunnr = SPACE             " accit-kunnr
*   i_lifnr = SPACE             " accit-lifnr
*   i_obzei = SPACE             " bseg-obzei
*   i_buzei =                   " bseg-buzei    Line Item Number Within the Accounting Document
*   i_bsegc =                   " bsegc         Document: Data on Payment Card Payments
*   x_lock = 'X'                " boole-boole   Data Element for BOOLE Domain: TRUE (='X') and FALSE (=' ')
*   i_bukrs =                   " bukrs
*   i_belnr =                   " belnr_d
*   i_gjahr =                   " gjahr
  TABLES
    t_accchg =                  " accchg
  EXCEPTIONS
    NO_REFERENCE = 1            "
    NO_DOCUMENT = 2             "
    MANY_DOCUMENTS = 3          "
    WRONG_INPUT = 4             "
    OVERWRITE_CREDITCARD = 5    "
    .  "  FI_DOCUMENT_CHANGE

ABAP code example for Function Module FI_DOCUMENT_CHANGE





The ABAP code below is a full code listing to execute function module FI_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_t_accchg  TYPE STANDARD TABLE OF ACCCHG,"TABLES PARAM
wa_t_accchg  LIKE LINE OF it_t_accchg .


DATA(ld_i_awtyp) = some text here

DATA(ld_i_awref) = some text here

DATA(ld_i_aworg) = some text here

DATA(ld_i_awsys) = some text here

DATA(ld_i_kunnr) = some text here

DATA(ld_i_lifnr) = some text here

SELECT single OBZEI
FROM BSEG
INTO @DATA(ld_i_obzei).


SELECT single BUZEI
FROM BSEG
INTO @DATA(ld_i_buzei).

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

DATA(ld_x_lock) = some text here
DATA(ld_i_bukrs) = 'Check type of data required'.
DATA(ld_i_belnr) = 'Check type of data required'.
DATA(ld_i_gjahr) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_accchg to it_t_accchg. . CALL FUNCTION 'FI_DOCUMENT_CHANGE' * EXPORTING * i_awtyp = ld_i_awtyp * i_awref = ld_i_awref * i_aworg = ld_i_aworg * i_awsys = ld_i_awsys * i_kunnr = ld_i_kunnr * i_lifnr = ld_i_lifnr * i_obzei = ld_i_obzei * i_buzei = ld_i_buzei * i_bsegc = ld_i_bsegc * x_lock = ld_x_lock * i_bukrs = ld_i_bukrs * i_belnr = ld_i_belnr * i_gjahr = ld_i_gjahr TABLES t_accchg = it_t_accchg EXCEPTIONS NO_REFERENCE = 1 NO_DOCUMENT = 2 MANY_DOCUMENTS = 3 WRONG_INPUT = 4 OVERWRITE_CREDITCARD = 5 . " FI_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 ELSEIF SY-SUBRC EQ 5. "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_awtyp  TYPE ACCHD-AWTYP ,
it_t_accchg  TYPE STANDARD TABLE OF ACCCHG ,
wa_t_accchg  LIKE LINE OF it_t_accchg,
ld_i_awref  TYPE ACCHD-AWREF ,
ld_i_aworg  TYPE ACCHD-AWORG ,
ld_i_awsys  TYPE ACCHD-AWSYS ,
ld_i_kunnr  TYPE ACCIT-KUNNR ,
ld_i_lifnr  TYPE ACCIT-LIFNR ,
ld_i_obzei  TYPE BSEG-OBZEI ,
ld_i_buzei  TYPE BSEG-BUZEI ,
ld_i_bsegc  TYPE BSEGC ,
ld_x_lock  TYPE BOOLE-BOOLE ,
ld_i_bukrs  TYPE BUKRS ,
ld_i_belnr  TYPE BELNR_D ,
ld_i_gjahr  TYPE GJAHR .


ld_i_awtyp = some text here

"populate fields of struture and append to itab
append wa_t_accchg to it_t_accchg.

ld_i_awref = some text here

ld_i_aworg = some text here

ld_i_awsys = some text here

ld_i_kunnr = some text here

ld_i_lifnr = some text here

SELECT single OBZEI
FROM BSEG
INTO ld_i_obzei.


SELECT single BUZEI
FROM BSEG
INTO ld_i_buzei.

ld_i_bsegc = 'Check type of data required'.

ld_x_lock = some text here
ld_i_bukrs = 'Check type of data required'.
ld_i_belnr = 'Check type of data required'.
ld_i_gjahr = 'Check type of data required'.

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