sap web gui login

http://molgaard.consolut.eu/sap/bc/gui/sap/its/webgui

Friday, July 18, 2014

Performance Tuning using Parallel Cursor

*&---------------------------------------------------------------------*
*& Report  ZPARALLEL_CURSORS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZPARALLEL_CURSORS NO STANDARD PAGE HEADING MESSAGE-ID zmymsg_parallel LINE-COUNT 70000(1000LINE-SIZE 500.

TABLES:
  likp
,
  lips
.

Data:
  t_likp  
type table of likp,
  t_lips  
type TABLE OF lips.

data:
  W_RUNTIME1 
TYPE I,
  W_RUNTIME2 
TYPE I,
  W_RUNTIME3 
TYPE I,
  W_RUNTIME4 
TYPE I,
  W_INDEX 
TYPE SY-TABIX.

START-OF-SELECTION.
  
select *
    
from likp
    
into table t_likp.

  
select *
    
from lips
    
into table t_lips.

  
get RUN TIME FIELD w_runtime1.

  
loop at t_likp into likp.
    
loop at t_lips into lips where vbeln eq likp-vbeln.
    
endloop.
  
endloop.

  
get RUN TIME FIELD w_runtime2.

  w_runtime2 
w_runtime2 w_runtime1.

  
write'LOOP INSIDE LOOP 'w_runtime2.
****************************************************
  
get RUN TIME FIELD w_runtime3.

  
loop at t_lips into lips.
    
READ TABLE t_likp into likp with key vbeln LIPS-VBELN.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'READ INSIDE LOOP'w_runtime4.
*****************************************************

****************************************************
  
SORT T_LIKP BY VBELN.
  
get RUN TIME FIELD w_runtime3.

  
loop at t_lips into lips.
    
READ TABLE t_likp into likp with key vbeln LIPS-VBELN BINARY SEARCH.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'READ INSIDE LOOP BINARY SEARCH'w_runtime4.
*****************************************************

****************************************************
  
get RUN TIME FIELD w_runtime3.
  
SORT T_LIPS BY VBELN.
  
loop at t_liKP into liKP.
*  READ TABLE t_likp into likp with key vbeln = LIPS-VBELN.
    
LOOP AT T_LIPS INTO LIPS FROM W_INDEX.
      
IF LIKP-VBELN <> LIPS-VBELN.
        W_INDEX 
SY-TABIX.
        
EXIT.
      
ENDIF.
    
ENDLOOP.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'PARLLEL'w_runtime4.
*****************************************************




*&---------------------------------------------------------------------*
*& Report  ZPARALLEL_CURSORS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZPARALLEL_CURSORS NO STANDARD PAGE HEADING MESSAGE-ID zmymsg_parallel LINE-COUNT 70000(1000LINE-SIZE 500.

TABLES:
  likp
,
  lips
.

Data:
  t_likp  
type table of likp,
  t_lips  
type TABLE OF lips.

data:
  W_RUNTIME1 
TYPE I,
  W_RUNTIME2 
TYPE I,
  W_RUNTIME3 
TYPE I,
  W_RUNTIME4 
TYPE I,
  W_INDEX 
TYPE SY-TABIX.

START-OF-SELECTION.
  
select *
    
from likp
    
into table t_likp.

  
select *
    
from lips
    
into table t_lips.

  
get RUN TIME FIELD w_runtime1.

  
loop at t_likp into likp.
    
loop at t_lips into lips where vbeln eq likp-vbeln.
    
endloop.
  
endloop.

  
get RUN TIME FIELD w_runtime2.

  w_runtime2 
w_runtime2 w_runtime1.

  
write'LOOP INSIDE LOOP 'w_runtime2.
****************************************************
  
get RUN TIME FIELD w_runtime3.

  
loop at t_lips into lips.
    
READ TABLE t_likp into likp with key vbeln LIPS-VBELN.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'READ INSIDE LOOP'w_runtime4.
*****************************************************

****************************************************
  
SORT T_LIKP BY VBELN.
  
get RUN TIME FIELD w_runtime3.

  
loop at t_lips into lips.
    
READ TABLE t_likp into likp with key vbeln LIPS-VBELN BINARY SEARCH.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'READ INSIDE LOOP BINARY SEARCH'w_runtime4.
*****************************************************

****************************************************
  
get RUN TIME FIELD w_runtime3.
  
SORT T_LIPS BY VBELN.
  
loop at t_liKP into liKP.
*  READ TABLE t_likp into likp with key vbeln = LIPS-VBELN.
    
LOOP AT T_LIPS INTO LIPS FROM W_INDEX.
      
IF LIKP-VBELN <> LIPS-VBELN.
        W_INDEX 
SY-TABIX.
        
EXIT.
      
ENDIF.
    
ENDLOOP.
  
endloop.

  
get RUN TIME FIELD w_runtime4.

  w_runtime4 
w_runtime4 w_runtime3.

  
write/'PARLLEL'w_runtime4.
*****************************************************



0 comments:

Post a Comment