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: 

Performance Tuning

Former Member
0 Kudos

hi all,

Performance wise which is correct one.

1. select * from vbrk into ivbrk where vbeln in s_vbeln

select kunnr name1 regio from kna1 for all entries in ivbrk where kunnr = ivbrk-kunag.

loop at ivbrk.

read table ikna1 with keykunnr = ivbrk-kunag.

if sy-subrc = 0.

ivbrk-regio = ikna1-regio.

endif.

modify ivbrk transporting regio.

endloop.

2. select * from vbrk into ivbrk where vbeln in s_vbeln

loop at ivbrk.

select single regio name1 from kna1 into (v_regio,v_name1) where kunnr = ivbrk-kunag.

ivbrk-regio = v_regio.

modify ivbrk transporting regio.

endloop.

in first one im selcting datas in ikna1 by select statement and within loop endloop am reading the internal table ikna1.

in second one within loop and endloop and using select single to to fetch data from kna1.

here everytime am hitting database table using select single.

So can you please tell me which is correct for improving the performance tunning.

regards,

Ramya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

use first one and modify like this

select * from vbrk into TABLE ivbrk where vbeln in s_vbeln.

SORT IVBRK.

DELETE ADJACENT DUPLICATES FROM IVBRK COMPARING KUNNR.

IF IVBRK[] IS NOT INITIAL.

select kunnr name1 regio from kna1INTO TABLE IKNA1 for all entries in ivbrk where kunnr = ivbrk-kunag.

ENDIF.

loop at ivbrk.

read table ikna1 with key kunnr = ivbrk-kunag.

if sy-subrc = 0.

ivbrk-regio = ikna1-regio.

endif.

modify ivbrk transporting regio.

CLEAR IVBRK,IKNA1.

endloop.

reward points to all helpful answers

kiran.M

4 REPLIES 4

Former Member
0 Kudos

first one is better

Former Member
0 Kudos

first one is correct. it will definitely improve perfomance.

Sameer

Former Member
0 Kudos

Hi

use first one and modify like this

select * from vbrk into TABLE ivbrk where vbeln in s_vbeln.

SORT IVBRK.

DELETE ADJACENT DUPLICATES FROM IVBRK COMPARING KUNNR.

IF IVBRK[] IS NOT INITIAL.

select kunnr name1 regio from kna1INTO TABLE IKNA1 for all entries in ivbrk where kunnr = ivbrk-kunag.

ENDIF.

loop at ivbrk.

read table ikna1 with key kunnr = ivbrk-kunag.

if sy-subrc = 0.

ivbrk-regio = ikna1-regio.

endif.

modify ivbrk transporting regio.

CLEAR IVBRK,IKNA1.

endloop.

reward points to all helpful answers

kiran.M

Former Member
0 Kudos

Ramya

CLOSE THIS THREAD IF SOLVED