Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module to read Fi document

tarangini_katta
Active Contributor
0 Likes
6,160

Hi All,

I want to read the data from BKPF and BSEG tables by passing the company code, document type and fiscal year.I am able to read using select but i need a function module to read the data.

Can yanybody please give m a function module.

Thanks,

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
2,475

use this Fm.

FI_DOCUMENT_READ

Read only

0 Likes
2,475

So it makes sense to use a function instead of carrying short is not it?


Examples


SELECT   BUKRS  KUNNR UMSKZ ZUONR GJAHR BELNR BUZEI BUDAT
   BLDAT WAERS BLART SHKZG GSBER DMBTR WRBTR SGTXT SAKNR HKONT
   ZFBDT ZBD1T ZBD2T ZBD3T XREF1 XREF2 XREF3
APPENDING TABLE IBSID
FROM BSID
                     WHERE BUKRS EQ BUKRS
                     AND KUNNR IN S_HKONT
                     AND UMSKZ IN S_UMSKZ
                     AND BUDAT LE GV_DATUM
                     AND HKONT NOT IN S_BKONT
                    AND GSBER IN GSBER .

Read only

Former Member
0 Likes
2,475

hi,

check these function modules:

for bseg table:

GET_ALL_BSEG : for Retrieval of all line items found by SET_ALL_BSEG

READ_BSEG : for Direct read operation of the line item

SET_ALL_BSEG: for Select all line items for a document

for bkpf table:

READ_BKPF : for Direct read operation of document headers

hope it will help you

regards

Rahul

Read only

Former Member
2,475

use this as a reference:


call function 'FI_DOCUMENT_READ'
exporting
   i_awtyp = 'VBRK'
   i_awref = vbfa_tab-vbeln
   i_awsys = vbrk-logsys
   i_bukrs = vbrk-bukrs
   i_gjahr = vbrk-gjahr
tables
   t_bkpf = xbkpf
   t_bseg = xbseg
exceptions
wrong_input = 1
not_found = 2.

regards,

Mon Magallanes

Read only

0 Likes
2,475

Hi Edmund ,

more illustrative examples of this function module yet ?

Regards Rasim.

Read only

0 Likes
2,475

So it makes sense to use a function instead of carrying short is not it?


Examples


SELECT   BUKRS  KUNNR UMSKZ ZUONR GJAHR BELNR BUZEI BUDAT
   BLDAT WAERS BLART SHKZG GSBER DMBTR WRBTR SGTXT SAKNR HKONT
   ZFBDT ZBD1T ZBD2T ZBD3T XREF1 XREF2 XREF3
APPENDING TABLE IBSID
FROM BSID
                     WHERE BUKRS EQ BUKRS
                     AND KUNNR IN S_HKONT
                     AND UMSKZ IN S_UMSKZ
                     AND BUDAT LE GV_DATUM
                     AND HKONT NOT IN S_BKONT
                    AND GSBER IN GSBER .