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

Query

Former Member
0 Likes
500

Hi all

I have 2 tables AD01DLI and ADO1DLIEF, i want to retrieve data, where dlinr value doest not match each of the two tables, and dopen field of table AD01DLIEF is not blank(' '), and there is an internal able T_COVP which has field blenr that should match with AD01DLI blenr.

As the data is too large in both of the tables .i need to do using single select statement, performace issue,

can any of u can guide me

rgds

anu

3 REPLIES 3
Read only

Former Member
0 Likes
443

use the Package size option to limit the number of records each time , when n is the number of records selected at one time


SELECT *
 FROM <table>
 INTO TABLE itab
 PACKAGE SIZE <n>.

IF sy-subrc EQ 0.
*" Process the n records
ENDIF.

ENDSELECT.

Read only

Former Member
0 Likes
443
  • Declare the internal table containing the required fields from both table.

<b>select</b> * into table itab from AD01DLI as a inner join ADO1DLIEF as b on AD01DLI - field <> ADO1DLIEF-field

where dopen <> ' '.

<b>if</b> not itab is initial.

<b>loop</b> at itab.

<b>read table</b> T_COVP with key blenr = itab1-blenr.

<b>if</b> sy-subrc <> 0.

<b>delete</b> the particular record.

<b>endif.</b>

<b>endloop.</b>

Read only

Former Member
0 Likes
443

Hi,

Try to create a database view for tables AD01DLI and ADO1DLIEF. Retreive data from database view and T_COVP table belnr check with AD01DLI belnr field.

Regards

Bhupal Reddy