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

FI_DOCUMENT_READ usage information.

former_member216215
Participant
0 Likes
4,801

Hi Everybody,

About how to use this function Does anyone have an idea?


I've found it.


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.

But this is not enough.

Best Regards Rasim.



15 REPLIES 15
Read only

ThomasZloch
Active Contributor
0 Likes
3,473

Your issue is not clear to me, please provide more information about what you are trying to solve.


Thomas

Read only

0 Likes
3,473

Thank Zloch

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 .


Regards Rasim

Read only

0 Likes
3,473

Instead of choosing a long time I want to use a function.

Read only

0 Likes
3,473

In very general, using SAP provided function modules or BAPIs is recommended to retrieve data for a particular document, be it FI document, purchase order or whatever.

However in my experience when you want to retrieve a large chunk of data i.e. thousands of documents, you are often better off by writing your own optimized access (if you know what you are doing, that is).

What is your actual business requirement?

Thomas

Read only

Former Member
0 Likes
3,473

Hi,

It seems, he is trying to fetch the accounting documents for a billing document. ( BKPF-AWKEY = 'VBRK' ).

Regards,

DPM

Read only

ThangaPrakash
Active Contributor
0 Likes
3,473

Hello Rasim,

No need to pass all datas.... Just pass the type and document number as below and you will get details in the tables.

Regards,

Thanga Prakash T

Read only

0 Likes
3,473

Thank Thanga ,

How do we do it?


Regards Rasim .

Read only

ThangaPrakash
Active Contributor
0 Likes
3,473

Hello Rasim,

Please refer screenshot in my previous comment, pass I_AWTYP and I_AWREF and the result you will get in the internal tables.

Regards,

Thanga

Read only

0 Likes
3,473

Ok. Thank you.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,473

This FI FM will return accounting documents generated from another application (here SD invoice, so one document most of the time) so the  SELECT statement in your answer to

Read only

0 Likes
3,473

That's it. You're so right. Raymond.


when you read the FI table, I'm looking for function modules can use SELECT instead.


Regards Rasim.


Read only

0 Likes
3,473

Select Instead, I want to read the function module table with them. BSEG , BKPF , SKAT ,T005T  , LFA1 , KNA1 , T001 , BSID ...


Regards Rasim...

Read only

0 Likes
3,473

???

Read only

0 Likes
3,473

If performance is not a problem, you can use the logical databases related to FI with a function module like LDB_PROCESS or use the LDB in report attributes (that's the old way)  - ref Calling a Logical Database Using a Function Module.

If performance is a problem, then select data from secondary indexes BS[I,A][S,D,K,M] and either join with required table or use FM like ITEM_DERIVE_FIELDS after a MOVE-CORRESPONDING of data to enrich data in a FBL*N fashion.

Regards,

Raymond

Read only

0 Likes
3,473

Thanks Raymond,

Logical Database will save my job.

Regards Rasim.