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

Using corresponding statement

Former Member
0 Likes
621

Hi All,

I am working on a report... in that particular report there are many places where the code has been written as follows:

SELECT  *
         APPENDING CORRESPONDING FIELDS OF TABLE t_zztest
         FROM   zztest
    where lgort = s_lgort.
sort t_zztest by lgort.

DATA BEGIN OF T_ZZtest OCCURS 0.
       INCLUDE STRUCTURE ZZtest.

SO I was just wondering if rather than using the appendind statment...

can I write like this..

SELECT  *
         APPENDING TABLE t_zztest
         FROM   zztest
    where lgort = s_lgort.
sort t_zztest by lgort.
binary search.      " can I add this

Thanks,

Rajeev

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
588

if table t_zztest and DB table zztest are of same structure you can do that..

another altenative... append lines of itab1 to itab2... itab1 and 2 need to be of same structure... least performance cost.

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
589

if table t_zztest and DB table zztest are of same structure you can do that..

another altenative... append lines of itab1 to itab2... itab1 and 2 need to be of same structure... least performance cost.

Read only

0 Likes
588

yes,move corresponding is used when there is type mismatch in the structure of db table and internal talble...or you just want to move some fields of db table to some field of internal table...

if this is not cse and both have ame structure..avoid move corresponding

Read only

Former Member
0 Likes
588

Rather than asking the forum (you haven't given enough information), you should just try it.

Rob

Read only

faisalatsap
Active Contributor
0 Likes
588

Hi,

I think it will be more efficient if you use like following,

Data: it_zztest  LIKE STANDARD TABLE OF zztest with header line.

SELECT  *  INTO CORRESPONDING FIELDS OF TABLE it_zztest
         FROM   zztest
    where lgort = s_lgort.

Kind Regards,

Faisal