SAP Function Modules

FI_DOCUMENT_READ SAP Function module







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

Associated Function Group: FACI
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM FI_DOCUMENT_READ - FI DOCUMENT READ





CALL FUNCTION 'FI_DOCUMENT_READ' "
* EXPORTING
*   i_awtyp =                   " acchd-awtyp   Organizational type in calling application
*   i_awref =                   " acchd-awref   Reference document number in calling application
*   i_aworg = SPACE             " acchd-aworg   Reference organizations in calling application
*   i_awsys = SPACE             " acchd-awsys   Logical system
*   i_xnbkl = SPACE             " accit-xauto   Read document header only
*   i_bukrs =                   " accit-bukrs   Company code
*   i_belnr =                   " bseg-belnr    FI document number
*   i_gjahr =                   " bseg-gjahr    Fiscal year
*   i_bstat = SPACE             " bstat_d       Document Status
*   i_xblnr = SPACE             " xblnr1        Reference Document Number
*   i_budat =                   " budat         Posting Date in the Document
*   i_blart = SPACE             " blart         Document Type
  IMPORTING
    e_awtyp =                   " acchd-awtyp
    e_awref =                   " acchd-awref
    e_aworg =                   " acchd-aworg
    e_awsys =                   " acchd-awsys
* TABLES
*   t_abuz =                    " abuz
*   t_acchd =                   " acchd
*   t_accit =                   " accit
*   t_acccr =                   " acccr
*   t_bkpf =                    " bkpf
*   t_bseg =                    " bseg
  EXCEPTIONS
    WRONG_INPUT = 1             "
    NOT_FOUND = 2               "
    .  "  FI_DOCUMENT_READ

ABAP code example for Function Module FI_DOCUMENT_READ





The ABAP code below is a full code listing to execute function module FI_DOCUMENT_READ 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_e_awtyp  TYPE ACCHD-AWTYP ,
ld_e_awref  TYPE ACCHD-AWREF ,
ld_e_aworg  TYPE ACCHD-AWORG ,
ld_e_awsys  TYPE ACCHD-AWSYS ,
it_t_abuz  TYPE STANDARD TABLE OF ABUZ,"TABLES PARAM
wa_t_abuz  LIKE LINE OF it_t_abuz ,
it_t_acchd  TYPE STANDARD TABLE OF ACCHD,"TABLES PARAM
wa_t_acchd  LIKE LINE OF it_t_acchd ,
it_t_accit  TYPE STANDARD TABLE OF ACCIT,"TABLES PARAM
wa_t_accit  LIKE LINE OF it_t_accit ,
it_t_acccr  TYPE STANDARD TABLE OF ACCCR,"TABLES PARAM
wa_t_acccr  LIKE LINE OF it_t_acccr ,
it_t_bkpf  TYPE STANDARD TABLE OF BKPF,"TABLES PARAM
wa_t_bkpf  LIKE LINE OF it_t_bkpf ,
it_t_bseg  TYPE STANDARD TABLE OF BSEG,"TABLES PARAM
wa_t_bseg  LIKE LINE OF it_t_bseg .


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_xnbkl) = some text here

DATA(ld_i_bukrs) = some text here

SELECT single BELNR
FROM BSEG
INTO @DATA(ld_i_belnr).


SELECT single GJAHR
FROM BSEG
INTO @DATA(ld_i_gjahr).

DATA(ld_i_bstat) = 'Check type of data required'.
DATA(ld_i_xblnr) = 'Check type of data required'.
DATA(ld_i_budat) = 'Check type of data required'.
DATA(ld_i_blart) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_abuz to it_t_abuz.

"populate fields of struture and append to itab
append wa_t_acchd to it_t_acchd.

"populate fields of struture and append to itab
append wa_t_accit to it_t_accit.

"populate fields of struture and append to itab
append wa_t_acccr to it_t_acccr.

"populate fields of struture and append to itab
append wa_t_bkpf to it_t_bkpf.

"populate fields of struture and append to itab
append wa_t_bseg to it_t_bseg. . CALL FUNCTION 'FI_DOCUMENT_READ' * EXPORTING * i_awtyp = ld_i_awtyp * i_awref = ld_i_awref * i_aworg = ld_i_aworg * i_awsys = ld_i_awsys * i_xnbkl = ld_i_xnbkl * i_bukrs = ld_i_bukrs * i_belnr = ld_i_belnr * i_gjahr = ld_i_gjahr * i_bstat = ld_i_bstat * i_xblnr = ld_i_xblnr * i_budat = ld_i_budat * i_blart = ld_i_blart IMPORTING e_awtyp = ld_e_awtyp e_awref = ld_e_awref e_aworg = ld_e_aworg e_awsys = ld_e_awsys * TABLES * t_abuz = it_t_abuz * t_acchd = it_t_acchd * t_accit = it_t_accit * t_acccr = it_t_acccr * t_bkpf = it_t_bkpf * t_bseg = it_t_bseg EXCEPTIONS WRONG_INPUT = 1 NOT_FOUND = 2 . " FI_DOCUMENT_READ
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 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_e_awtyp  TYPE ACCHD-AWTYP ,
ld_i_awtyp  TYPE ACCHD-AWTYP ,
it_t_abuz  TYPE STANDARD TABLE OF ABUZ ,
wa_t_abuz  LIKE LINE OF it_t_abuz,
ld_e_awref  TYPE ACCHD-AWREF ,
ld_i_awref  TYPE ACCHD-AWREF ,
it_t_acchd  TYPE STANDARD TABLE OF ACCHD ,
wa_t_acchd  LIKE LINE OF it_t_acchd,
ld_e_aworg  TYPE ACCHD-AWORG ,
ld_i_aworg  TYPE ACCHD-AWORG ,
it_t_accit  TYPE STANDARD TABLE OF ACCIT ,
wa_t_accit  LIKE LINE OF it_t_accit,
ld_e_awsys  TYPE ACCHD-AWSYS ,
ld_i_awsys  TYPE ACCHD-AWSYS ,
it_t_acccr  TYPE STANDARD TABLE OF ACCCR ,
wa_t_acccr  LIKE LINE OF it_t_acccr,
ld_i_xnbkl  TYPE ACCIT-XAUTO ,
it_t_bkpf  TYPE STANDARD TABLE OF BKPF ,
wa_t_bkpf  LIKE LINE OF it_t_bkpf,
ld_i_bukrs  TYPE ACCIT-BUKRS ,
it_t_bseg  TYPE STANDARD TABLE OF BSEG ,
wa_t_bseg  LIKE LINE OF it_t_bseg,
ld_i_belnr  TYPE BSEG-BELNR ,
ld_i_gjahr  TYPE BSEG-GJAHR ,
ld_i_bstat  TYPE BSTAT_D ,
ld_i_xblnr  TYPE XBLNR1 ,
ld_i_budat  TYPE BUDAT ,
ld_i_blart  TYPE BLART .


ld_i_awtyp = some text here

"populate fields of struture and append to itab
append wa_t_abuz to it_t_abuz.

ld_i_awref = some text here

"populate fields of struture and append to itab
append wa_t_acchd to it_t_acchd.

ld_i_aworg = some text here

"populate fields of struture and append to itab
append wa_t_accit to it_t_accit.

ld_i_awsys = some text here

"populate fields of struture and append to itab
append wa_t_acccr to it_t_acccr.

ld_i_xnbkl = some text here

"populate fields of struture and append to itab
append wa_t_bkpf to it_t_bkpf.

ld_i_bukrs = some text here

"populate fields of struture and append to itab
append wa_t_bseg to it_t_bseg.

SELECT single BELNR
FROM BSEG
INTO ld_i_belnr.


SELECT single GJAHR
FROM BSEG
INTO ld_i_gjahr.

ld_i_bstat = 'Check type of data required'.
ld_i_xblnr = 'Check type of data required'.
ld_i_budat = 'Check type of data required'.
ld_i_blart = '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_READ or its description.