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

Select statement

Former Member
0 Likes
459

Hi friends when we write

select single *

is it necessary to have a data base and the internal table of the same structure.

I am writing,

Select Single *

From ZZSD0010

into it_zzsd0010

Where

princ_customer = it_zzsd0010-princ_customer

default_sold_2 = 'X'.

the internal table and the data base table are of different structure.

Any suggestions,

Shejal Shetty.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
420

Hi,

IF the internal table and database structure are of different structure you can use INTO CORRESPONDING FIELDS OF..to move the common field values..

You cannot use INTO alone if the database table and internal table structure are different..

The values may not move to the correct fields..

THanks,

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
421

Hi,

IF the internal table and database structure are of different structure you can use INTO CORRESPONDING FIELDS OF..to move the common field values..

You cannot use INTO alone if the database table and internal table structure are different..

The values may not move to the correct fields..

THanks,

Naren

Read only

Former Member
0 Likes
420

Hi Shejal,

In case the db table and internal table are of different structure, then u need to write the fields you want to populate explicitly using corresponding fiels addition in select statement.

Select Single *

From ZZSD0010

into <b>CORRESPONDING FIELDS OF TABLE</b> it_zzsd0010

Where

princ_customer = it_zzsd0010-princ_customer and

default_sold_2 = 'X'.

Else if the structure is same then your statement will also work.

Cheers,

Vikram

Pls reward for helpful replies!!

Read only

0 Likes
420

thansk for the suggestions,

Shejal Shetty.