Skip to Content
avatar image
Former Member

Performance Tuning

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 21, 2007 at 11:50 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 11:46 AM

    first one is better

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 11:47 AM

    first one is correct. it will definitely improve perfomance.

    Sameer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 11:56 AM

    Ramya

    CLOSE THIS THREAD IF SOLVED

    Add comment
    10|10000 characters needed characters exceeded