How can I Improve performance of Below code.

Hi, 

As per my requirement i fetched multiple Queries, but while preparing final Internal table. 
Taking lot of time. One Scenario having 10 Days having 19k Records. Any possible way I Can improve the performance.

* SORT lt_cdpos BY changenr.
* SORT lt_user_addr BY bname.
* SORT lt_usr21 BY bname.
* SORT lt_adr6 BY persnumber.
LOOP AT lt_cdhdr ASSIGNING FIELD-SYMBOL(<ls_cdhdr>).
READ TABLE lt_cdpos WITH KEY changenr = <ls_cdhdr>-changenr ASSIGNING FIELD-SYMBOL(<ls_cdpos>).
IF sy-subrc = 0.
READ TABLE lt_user_addr WITH KEY bname = <ls_cdhdr>-username ASSIGNING FIELD-SYMBOL(<ls_user_addr>).
IF sy-subrc = 0.
READ TABLE lt_usr21 WITH KEY bname = <ls_user_addr>-bname ASSIGNING FIELD-SYMBOL(<ls_usr21>).
IF sy-subrc = 0.
READ TABLE lt_adr6 WITH KEY persnumber = <ls_usr21>-persnumber ASSIGNING FIELD-SYMBOL(<ls_adr6>).
ENDIF.
ENDIF.
ENDIF.
APPEND VALUE #( uname = <ls_cdhdr>-username
udate = <ls_cdhdr>-udate
utime = <ls_cdhdr>-utime
tcode = <ls_cdhdr>-tcode
Objvale = <ls_cdhdr>-objectid
tabname = <ls_cdpos>-tabname
fname = <ls_cdpos>-fname
valueold = <ls_cdpos>-value_old
valuenew = <ls_cdpos>-value_new
fstname = <ls_user_addr>-name_first
lstname = <ls_user_addr>-name_last
email = <ls_adr6>-smtp_addr ) TO rt_output.
ENDLOOP.

Scroll to Top