2014 Feb 03 4:09 PM
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.
2014 Feb 04 9:54 AM
Your issue is not clear to me, please provide more information about what you are trying to solve.
Thomas
2014 Feb 04 10:10 AM
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
2014 Feb 04 10:11 AM
2014 Feb 04 11:32 AM
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
2014 Feb 04 10:02 AM
Hi,
It seems, he is trying to fetch the accounting documents for a billing document. ( BKPF-AWKEY = 'VBRK' ).
Regards,
DPM
2014 Feb 04 12:12 PM
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
2014 Feb 04 12:21 PM
2014 Feb 04 12:46 PM
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
2014 Feb 04 1:09 PM
2014 Feb 04 2:46 PM
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 Thomas cannot be fulfilled with this FM. Also if you are on the original system, don't pass AWSYS as it will be initial in BKPF.
Regards,
Raymond
2014 Feb 04 3:01 PM
That's it. You're so right. Raymond.
Regards Rasim.
2014 Feb 04 3:21 PM
Select Instead, I want to read the function module table with them. BSEG , BKPF , SKAT ,T005T , LFA1 , KNA1 , T001 , BSID ...
Regards Rasim...
2014 Feb 04 3:46 PM
2014 Feb 04 3:55 PM
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
2014 Feb 04 4:52 PM
Thanks Raymond,
Logical Database will save my job.
Regards Rasim.