Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

about select-options

Former Member
0 Kudos
75

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

2 REPLIES 2

anversha_s
Active Contributor
0 Kudos
46

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

Former Member
0 Kudos
46

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