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 distinct field

Former Member
0 Likes
1,495

Hi all,

I have this question:

How to select records from a table to an itab choosing distinct values of a certain field (not the key) ?

Thanks,

Massimo

1 ACCEPTED SOLUTION
Read only

former_member582701
Contributor
0 Likes
1,314

SELECT DISTINCT <fields>

FROM <table>

INTO TABLE i_tab

WHERE <conditions>

Regards.

Reward all helpful answers

Hi all,

I have this question:

How to select records from a table to an itab choosing distinct values of a certain field (not the key) ?

Thanks,

Massimo

5 REPLIES 5
Read only

Former Member
0 Likes
1,314

Hi,

You can use SELECT DISTINCT

Try this..


SELECT DISTINCT( MATNR ) FROM VBAP INTO TABLE T_VBAP
             WHERE ....

Thanks,

Naren

Read only

former_member582701
Contributor
0 Likes
1,315

SELECT DISTINCT <fields>

FROM <table>

INTO TABLE i_tab

WHERE <conditions>

Regards.

Reward all helpful answers

Read only

Former Member
0 Likes
1,314

Hi

U can use SELECT DISTINCT

Max

Read only

Former Member
0 Likes
1,314

Hi

Give ur select statement like this.

select distinct <field name> from <Database table name> into <internal table name>

Eg: select distinct land1 from lfa1 into table it_lfa1.

Regards

Haritha.

Read only

Former Member
0 Likes
1,314

Hi Massimo,

Select all required data into internal table.suppose u want to remove duplicates of field2 .then use the below statement.

delete adjasent duplicates from itab comparing field2.

reward points if helpful.

Thanks,

Suma