‎2007 Nov 06 2:02 AM
Hi all,
here i ve dev a report that is fetching data from 2 tables with simple sql querry, it is working properly in dev, but in Quality its is giving Dump error, in quality its running almost 10min..
in dump its giving Memory Exausted error.
what is the wrong inthat select querry plz help..
REPORT ZEXCHANGE_RETES .
TABLES : tcurr, " Exchange Rates
/msg/rabr. " Account (Posting Headers)
DATA : l_date type datum.
TYPES : begin of t_tcurr,
kurst like tcurr-kurst, " Exchange Rate type
fcurr like tcurr-fcurr, " From Currrency
gdatu like tcurr-gdatu, " Date as of which
end of t_tcurr.
TYPES : begin of t_rabr,
OW_WHGNR like /msg/rabr-OW_WHGNR,
bil_date like /msg/rabr-bil_dat,
abrnr like /msg/rabr-abrnr,
end of t_rabr.
TYPES : begin of t_output,
OW_WHGNR like /msg/rabr-OW_WHGNR,
bil_date like /msg/rabr-bil_dat,
abrnr like /msg/rabr-abrnr,
kurst like tcurr-kurst,
fcurr like tcurr-fcurr,
gdatu like tcurr-gdatu,
end of t_output.
DATA : it_output TYPE STANDARD TABLE OF t_output WITH HEADER LINE,
wa_output TYPE t_output.
DATA : it_rabr TYPE STANDARD TABLE OF t_rabr WITH HEADER LINE,
wa_rabr TYPE t_rabr.
DATA : it_tcurr TYPE STANDARD TABLE OF t_tcurr WITH HEADER LINE,
wa_tcurr TYPE t_tcurr.
CLEAR : it_tcurr,
it_rabr,
it_output.
REFRESH : it_tcurr,
it_rabr,
it_output.
SELECT kurst fcurr gdatu
from tcurr into table it_tcurr
where kurst EQ 'M'.
SORT it_tcurr by GDATU descending.
READ table it_tcurr index 1.
IF SY-SUBRC = 0.
l_date = it_tcurr-gdatu.
ENDIF.
SELECT r~OW_WHGNR
r~bil_dat
r~abrnr
t~kurst
t~fcurr
t~gdatu
FROM tcurr as t INNER JOIN /msg/rabr as r on tfcurr = rOW_WHGNR into table it_output
WHERE tkurst EQ 'M' AND rabrnr BETWEEN '00000000000001228014' AND '00000000000001238014' AND r~bil_dat LE l_date .
LOOP at it_output into wa_output.
WRITE: /10 wa_output-kurst,
15 wa_output-fcurr,
25 wa_output-bil_date,
50 wa_output-OW_WHGNR,
60 wa_output-gdatu,
80 wa_output-abrnr.
ENDLOOP.
TOP-Of-PAGE.
FORMAT COLOR COL_HEADING.
WRITE : /3 'Exc R Type',
14 'F CURR',
25 'FI POS dste ',
48 'Ori CURR',
60 'Date',
75 'Account Number'.
FORMAT COLOR OFF.
SKIP .
Thanks and Regards,
sudharsan.
‎2007 Nov 06 2:09 AM
SELECT r~OW_WHGNR
r~bil_dat
r~abrnr
t~kurst
t~fcurr
t~gdatu
FROM tcurr as t INNER JOIN /msg/rabr as r on tfcurr = rOW_WHGNR into table it_output
WHERE tkurst EQ 'M' AND rabrnr BETWEEN '00000000000001228014' AND '00000000000001238014' AND r~bil_dat LE l_date .
Split the above select into 2 parts
select <data> from TCURR into table IT_TCURR in first step
Now use for all entries and
select <data> from /MSG/RABR where <Conditions> and OW_WHGNR = IT_TCURR-FCURR.
As a final step move all the data to IT_FINAL(declare all fields required as IT_FINAL)
This should improve the performance.
Regards
Gopi
‎2007 Nov 06 4:44 AM
Hi Gopi,
Thank u for replay, here according to u if i use FOR ALL ENTRIES the both table fields should be same type and lenth.
but here date field types r diff from 2 tables, one is for char type and 2nd one is DATES type.
then how to compare.
Regards,
sudharsan.
‎2007 Nov 06 2:10 AM
In Quality server are you having lots of data compared to development server.
Please give the details as specified in the ABAP dump analysis.
‎2007 Nov 06 2:22 AM
If the dump is due to time out error then
In Tcode : se30.
Click on <b>tips and tricks</b> button
There paste ur existing code and optimize your code and see the execution time difference. Click on measure runtime.
And use the most optimized code in your program in order to avoid run time, time out error.
‎2007 Nov 06 2:29 AM
Hi,
Try to analyze your code by SE30 and ST05. I dont think that the SQL needs more optimization. Maybe its taking time due to more data being there in Quality server which is normally the case.
Regards,
Nirmal