Application Development and Automation 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: 
Read only

ALV Report Performance

Former Member
0 Likes
688

HI ,

LOOP AT DD07V_TAB1.

N = 0.

LOOP AT DD07T_TAB WHERE DOMNAME = DD07V_TAB1-DOMNAME AND

DOMVALUE_L = DD07V_TAB1-DOMVALUE_L.

N = N + 1.

here there is loop under loop can any one pls write with read statment loop with read statment ,

iam thankful to u,

it is taking lot of time for executing

thanks in advance,

HI ,

LOOP AT DD07V_TAB1.

N = 0.

LOOP AT DD07T_TAB WHERE DOMNAME = DD07V_TAB1-DOMNAME AND

DOMVALUE_L = DD07V_TAB1-DOMVALUE_L.

N = N + 1.

here there is loop under loop can any one pls write with read statment loop with read statment ,

iam thankful to u,

it is taking lot of time for executing

thanks in advance,

4 REPLIES 4
Read only

Former Member
0 Likes
664

Hello


SORT DD07V_TAB1.
SORT DD07T_TAB BY DOMNAME DOMVALUE_L.
LOOP AT DD07V_TAB1.
N = 0.
READ TABLE DD07T_TAB WITH KEY DOMNAME = DD07V_TAB1-DOMNAME AND
DOMVALUE_L = DD07V_TAB1-DOMVALUE_L BINARY SEARCH.
N = N + 1.
...
ENDLOOP.

Read only

Former Member
0 Likes
664

Hi,

SORT DD07V_TAB.

SORT DD07T_TAB BY DOMNAME DOMVALUE.

LOOP AT DD07V_TAB1.

N = 0.

READ TABLE DD07T_TAB WITH KEY DOMNAME = DD07V_TAB1-DOMNAME AND

DOMVALUE_L = DD07V_TAB1-DOMVALUE_L.

IF SY-SUBRC EQ 0.

READ TABLE DD07T_TAB WITH KEY DOMNAME = DD07V_TAB1-DOMNAME AND

DOMVALUE_L = DD07V_TAB1-DOMVALUE_L.

IF SY-SUBRC EQ 0.

N = N + 1.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Rama.

Read only

Former Member
0 Likes
664

answered

Read only

Former Member
0 Likes
664

Please use this solution see section 3

Measurements on internal tables: Reads and Loops:

/people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables

or better use a sorted table as inner table.

And be aware, that only the inner table must be sorted, the other sort is a waste of time !!!

Siegfried