Hi All!
I tried to optimize a code for a long time but haven't been able to do so. I have made secondary indexes, created internal tables but the performance still has't improved. It takes 5 hours for 138,000 to look-up from a DSO containing a million records.
Tried tracing too from st05 found it takes time to open and fetch the data.
Following is the code:
if RESULT_PACKAGE is not INITIAL .
SELECT
/BIC/ZEMAIL
/BIC/ZMOBILE
HE_YRSES FROM /BIC/AZLMS_D0300
INTO TABLE LT_AZLMS_D0300 FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE /BIC/ZEMAIL eq RESULT_PACKAGE-/BIC/ZEMAIL or
/BIC/ZMOBILE eq RESULT_PACKAGE-/BIC/ZMOBILE .
if sy-subrc = 0.
sort LT_AZLMS_D0300 by HE_YRSES .
endif.
LOOP at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS> .
READ TABLE LT_AZLMS_D0300 INTO LS_AZLMS_D0300 WITH KEY
/BIC/ZEMAIL = <RESULT_FIELDS>-/BIC/ZEMAIL .
if sy-subrc = 0 .
<RESULT_FIELDS>-/BIC/ZHE_LCYSE = LS_AZLMS_D0300-HE_YRSES .
if <RESULT_FIELDS>-/BIC/ZHE_LCYSE EQ <RESULT_FIELDS>-HE_YRSES
.
<RESULT_FIELDS>-/BIC/ZSTATU = 'N' .
else.
<RESULT_FIELDS>-/BIC/ZSTATU = 'L' .
endif.
else.
READ TABLE LT_AZLMS_D0300 INTO LS_AZLMS_D0300 WITH KEY
/BIC/ZMOBILE =
<RESULT_FIELDS>-/BIC/ZMOBILE .
if sy-subrc = 0.
<RESULT_FIELDS>-/BIC/ZHE_YRSES = LS_AZLMS_D0300-HE_YRSES .
if <RESULT_FIELDS>-/BIC/ZHE_LCYSE EQ <RESULT_FIELDS>-HE_YRSES
.
<RESULT_FIELDS>-/BIC/ZSTATU = 'N' .
else.
<RESULT_FIELDS>-/BIC/ZSTATU = 'L' .
endif.
endif.
ENDIF .
CLEAR : LS_AZLMS_D0300 .
ENDLOOP .
endif .
Thanks,
Kunal