03-04-2017 5:05 PM
Hi Experts,
I have a question for ABAPER, in my program fetching data from BKPF table based on input fields BELNR, GJAHR and XBLNR. Here XBLNR is a non primary key field, so when data volume is huge system giving dump at BKPF table select query. Anyone can help on this whether i need to create secondary index for BKPF table or I need to fetch data based on BELNR and GJAHR then in loop i will filter by xblnr.
Which one is better performance.
Thanks,
Pradeep.
03-06-2017 8:51 AM
You should look into creating a secondary index if it is not already in place.
Check with your BASIS-team and perhaps do some tests around this ...
I see a lot of SAP-KBA's with regard to the use of (secondary) indexes on table 'BKPF' in SAP-Standard FunctionModules. So if SAP-Stdrd makes use of it, it is worth checking this out for your own Development as well.
03-06-2017 9:50 AM
There is an index with XBLNR but it also require BUKRS and BSTAT. Check with functional if you are able to provide those values too. Also I'm surprised you don't already use BUKRS field.
03-06-2017 1:13 PM
What am I missing here...
.
An ABAP loop after bringing all the data over to the application server will never be as efficient as even letting the database server work on un-indexed data. That said, as Raymond said - there is an index - figure out how to use it!
03-06-2017 4:24 PM
Use all the three Key fields "BUKRS", BELNR" and "GJAHR" to fetch data from BKPF.