‎2009 Feb 20 8:27 AM
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,
‎2009 Feb 20 8:34 AM
‎2014 Feb 04 9:43 AM
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 .
‎2009 Feb 20 8:36 AM
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
‎2009 Feb 20 8:37 AM
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
‎2014 Feb 04 8:04 AM
Hi Edmund ,
‎2014 Feb 04 9:42 AM
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 .