Hi ,
We have 3.5 million records in BKPF. we an have application which search the documents based on document type, doc status, doc date and posting date. The below select statement taking 2mins to get the data.
- Package size is used to avoid shortdumps/memory issues as it is huge table
- Once I receive the data into internal table, i will filter based on posting date and doc date and any other filters.
SELECT bukrs belnr gjahr blart bldat budat USNAM XBLNR BKTXT BSTAT
FROM bkpf
INTO TABLE gt_bkpf_tmp package size 50000
WHERE bukrs EQ '1010'
AND ( bstat = 'V' OR bstat = '' OR bstat NE 'Z' ) "IN gr_bstat
AND ( blart = 'AB' OR blart = 'SA' OR blart = 'IS' OR blart = 'SK' )
if sy-subrc = 0.
append lines of gt_bkpf_tmp to gt_bkpf.
free: gt_bkpf_tmp.
endif.
endselect.
Any inputs to improve the performance?
Any function module i can use to retreive the data from BKPF?
I used FM "GLE_MCA_READ_BKPF", but it is not of much use. Above select statement is running much faster as we are using index (BKPF~3)
Thanks