2006 Sep 24 3:07 AM
hi friends
see the below code when i use the code2 performance is very poor.
with code1 perfomance is good but iam getting the no of records is little more in code 1
for example with code1 iam getting 20100 records
with code2 iam getting 20000 only
actually the code2 is correct way of getting the records but i want to improve the performance
so i want to chage the select-option into parameter without duplicates
below i want to change gr_hkont into parameters
code1............
loop at gr_hkont.
SELECT bukrs hkont gjahr belnr buzei budat shkzg gsber dmbtr
aufnr bewar vbund monat
into table t_glall
FROM bsis
WHERE bukrs IN s_bukrs
AND hkont between gr_hkont-low and gr_hkont-high.
delete t_glall where budat not between g_firstday and g_lastday.
append lines of t_glall to t_glall1.
endloop.
delete adjacent duplicates from t_glall1.
code2.............
SELECT bukrs hkont gjahr belnr buzei budat shkzg gsber dmbtr
aufnr bewar vbund monat
INTO CORRESPONDING FIELDS OF TABLE t_glall
FROM bsis
WHERE bukrs IN s_bukrs
AND hkont in gr_hkont
AND budat >= g_firstday
AND budat <= g_lastday.
please send me where the no of records getting the difference and how can we get the same no of recs
thanks in advance
regards
jagadish
hi friends
see the below code when i use the code2 performance is very poor.
with code1 perfomance is good but iam getting the no of records is little more in code 1
for example with code1 iam getting 20100 records
with code2 iam getting 20000 only
actually the code2 is correct way of getting the records but i want to improve the performance
so i want to chage the select-option into parameter without duplicates
below i want to change gr_hkont into parameters
code1............
loop at gr_hkont.
SELECT bukrs hkont gjahr belnr buzei budat shkzg gsber dmbtr
aufnr bewar vbund monat
into table t_glall
FROM bsis
WHERE bukrs IN s_bukrs
AND hkont between gr_hkont-low and gr_hkont-high.
delete t_glall where budat not between g_firstday and g_lastday.
append lines of t_glall to t_glall1.
endloop.
delete adjacent duplicates from t_glall1.
code2.............
SELECT bukrs hkont gjahr belnr buzei budat shkzg gsber dmbtr
aufnr bewar vbund monat
INTO CORRESPONDING FIELDS OF TABLE t_glall
FROM bsis
WHERE bukrs IN s_bukrs
AND hkont in gr_hkont
AND budat >= g_firstday
AND budat <= g_lastday.
please send me where the no of records getting the difference and how can we get the same no of recs
thanks in advance
regards
jagadish
2006 Sep 24 7:46 AM
hi jagadish,
code1 ->hkont between gr_hkont-low and gr_hkont-high
it means it will not consider gr_hkont-low and gr_hkont-high, only the values in btwn them
code2 ->hkont in gr_hkont it means , its considering both gr_hkont-low and gr_hkont-high.
thsts the difference.
rgds
anver
pls mark points if helepd
2006 Sep 25 5:35 AM
Hello,
Code1:
Remove the select statment from the loop.And u can use for all entries in stament.
Example:
SELECT bukrs hkont gjahr belnr buzei budat shkzg gsber dmbtr
aufnr bewar vbund monat
into table t_glall
FROM bsis for all entries in gr_hkont
WHERE bukrs IN s_bukrs
AND hkont between gr_hkont-low and gr_hkont-high.
Code2:
Please let me know waht condition u want there.
Check and let me knww.
Regards
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |