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

Excluding one field in select statement

Former Member
0 Likes
5,719

Hi Leads,

My table has 150 fields in total. from that I want to select only 149 fields into Internal table.

Is there any way to exclude only one field in the select statement, instead of writing all 149 fields?

Regards

Sandip

1 ACCEPTED SOLUTION
Read only

christine_evans
Active Contributor
0 Likes
2,753

>

> Hi Leads,

>

> My table has 150 fields in total. from that I want to select only 149 fields into Internal table.

> Is there any way to exclude only one field in the select statement, instead of writing all 149 fields?

>

> Regards

> Sandip

I'd use SELECT *. What difference does one extra field make anyway? Unless it is a very long field.

Hi Leads,

My table has 150 fields in total. from that I want to select only 149 fields into Internal table.

Is there any way to exclude only one field in the select statement, instead of writing all 149 fields?

Regards

Sandip

7 REPLIES 7
Read only

Former Member
0 Likes
2,753

Hi,

You can follow one smart trick.

Decalare a table type of same table by copying all fields.then remove the fields which do you not want to select.

then write Select Query as belwo

Select * from Database_Table name into corresponding fields of table Table_name....

-Rick

Read only

0 Likes
2,753

hi,

you can declare the internal table with all the 150 fields...

in select also

select * from db into itab where some condition...

so in your internal table you will have all the 150 fields...use 149 fields and let the 150th field be there..it wont cause any problem

try not to use move corresponding as far as possible..

Read only

christine_evans
Active Contributor
0 Likes
2,754

>

> Hi Leads,

>

> My table has 150 fields in total. from that I want to select only 149 fields into Internal table.

> Is there any way to exclude only one field in the select statement, instead of writing all 149 fields?

>

> Regards

> Sandip

I'd use SELECT *. What difference does one extra field make anyway? Unless it is a very long field.

Read only

Former Member
0 Likes
2,753

Hi,

you have an option in SAP

GOTO ---> Pattern ---> radiobutton select * from  give the table name

it will ask you to select the fields you want you can check the fields you want and it will automatically write the select query.

regards

sarves

Read only

viquar_iqbal
Active Contributor
0 Likes
2,753

Hi

click on pattern ->structured data object->with fields from structure->enter the name of table select fields click on ok and youll get the table with selected fields

Thanks

Viquar Iqbal

Read only

Former Member
0 Likes
2,753

hi..

I hav the requirement where I want to exclude MANDT field out of 150 fields.

So..I jus asked...

Anywayz...Got the short cut... and thanx for all the responses.

Regards

Sandip

Read only

Former Member
0 Likes
2,753

hi:

1st - create an internal table containing 149 fields

2nd - select * from table into corresponding fields of 1st

Regards

Shashi