04-28-2011 5:20 PM
Hi All,
I am working on a report where i need to get the data from few tables and get it displayed, in the requirement I need to get some data from REGUP based on the vendor and then I am trying to retrieve the information from PAYR table such as check #, check date. So far I have tried selecting the information from REGUP using the vendor number entered by the user and then I am doing a select on PAYR to get the other information for all the entries in my REGUP internal table. Using a simple select statement is taking lot of time and I am having performance issues, can you please suggest any better approach? I understand REGUP is a huge table.
Thanks,
Raj
04-28-2011 7:50 PM
Hello,
First, you need to read the REGUH table, because is most easy to link with this field and to reduce the performance problems,
Best regards
DL
04-28-2011 5:28 PM
Hi
See SAP Note 574350 - F110: Reorganization of payment data. As the note tells, it's usual reorginize this data to avoid performance problems, or as it suggests, delete only data from proposals.
I hope this helps you
Regards
Eduardo
04-28-2011 6:02 PM
But it sounds like the PAYR table SELECT is the issue right? Have you traced the selection? PAYR is indexed by co code/payment document and these are the values you should be using for the check lookup. What index is your program using?
04-28-2011 6:11 PM
hey Brad,
Even selecting from REGUP is a concern but selecting from PAYR is taking more time, I am doing a select on PAYR based on the following fields:
LAUFD and LAUFI. so my statement is like this:
Select CHECT BANCD
from PAYR
for all entries in it_regup
where laufd = it_regup-laufd
and laufi = it_regup-laufi
and ZBUKR = 'ZTC'.
thanks,
Rajat Garg
04-28-2011 6:17 PM
You need a custom index then, but you really should be using the payment doc fields from REGUP and leveraging the PAYR~B index on PAYR. You're probably running a scan on PAYR now.
04-28-2011 7:50 PM
Hello,
First, you need to read the REGUH table, because is most easy to link with this field and to reduce the performance problems,
Best regards
DL
04-28-2011 8:44 PM
Thanks for the reply David, So what I can do is like this and will it increase the performance?:
Select
vblnr
from reguh
into it_data_reguh
where lifnr in s_lifnr.
select
laufd
laufi
belnr
dmbtr
bldat
from regup
for all entries in it_data_regup
into it_data_regup
where belnr = it_data_reguh-vblnr
and lifnr = it_data_reguh-lifnr.
sort it_data_regup.
select chect
bancd
for all entries in it_data_regup
into it_data_payr
where laufd = it_data_regup-laufd
and laufi = it_data_regup-laufi
and ZBUKR = 'ZTC'.
04-28-2011 9:31 PM
You need to index REGUH by LIFNR then. There isn't standard index support for LIFNR. You will stop a table scan on REGUP (cluster table) using that approach, but if PAYR was your major performance limiter before, it still is now as well. You haven't done anything to improve that read yet.
04-29-2011 5:21 AM
Hi Raja,
RUGUH is Payment header table and REGUP is payment item table.
If your basic requirement is to pick data from PAYR table only then why don't you write query as below,
Select
laufd
laufi
hktid
hbkid
from reguh
into table it_data_reguh
where ZBUKR = 'ZTC'
AND lifnr in s_lifnr.
sort it_data_reguH.
select chect
bancd
for all entries in it_data_reguH
into table it_data_payr
where ZBUKR = 'ZTC'
AND hbkid = it_data_reguH-hbkid
AND HKTID = it_data_reguH-hKTid
AND laufd = it_data_reguH-laufd
and laufi = it_data_reguH-laufi.
After doing above you can pick entries from REGUP if required as REGUP contains item details against the paymnt header details IN REGUH, you will also find all key fields of REGUP table from REGUH table hence your performance will definitely get improve.
Hope it will help you.
Regards,
Umang Mehta