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

for all entry

Former Member
0 Likes
878

1. how can i get the duplicate data while using on for all entry?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
853

Maybe a query like this:

select field from table into corresponding fields of i_table group by field having count( * ) > 1.

8 REPLIES 8
Read only

Former Member
0 Likes
854

Maybe a query like this:

select field from table into corresponding fields of i_table group by field having count( * ) > 1.

Read only

Former Member
0 Likes
853

Hi Chakri,

When you use FOR ALL ENTRIES syntax, the data is fetched based on the data stored in the first internal table, on which you write , IF NOT INITIAL condiiton.

I general, FOR ALL ENTRIES does not fetch duplicate entries, so it is better to opt for writing seperate SELECT stmts. to fetch the data as per your requirement.

Hope this is helpful to you. If you need further information, revert back.

Reward all the helpful answers.

Regards

Nagaraj T

Read only

Former Member
0 Likes
853

hi,

say if the source table has duplicate entries:

1

1

2

3

3

3

if you dont delete the duplicates and use it in for all entries to fetch data, ex. 1 occurs twice, the same data will be fetched twice. same is the case for 3 too. if u delete the duplicates, only once the matching data will be fetched.

regards,

madhu

Read only

Former Member
0 Likes
853

For ALL ENTRIES doesnt give u a duplicate data depending on the selected tables. If it is so you can use

DELETE ADJACENT DUPLICATES FROM it_table.

Read only

chaiphon
Contributor
0 Likes
853

For all entries in select statement always deletes duplicates data in result internal table comparing all fields.

Therefore, If you want some duplicates data in some fields, I suggest you to get all key fields of the selected table into your internal table then you will get duplicates data you want.

Regards,

Chaiphon Pulnitiporn

Read only

Former Member
0 Likes
853

Please ask your question properly, the database table can not have duplicates, because the primary key MUST be unique. If you select which

FOR ALL ENTRIES with Select * or Select primary key, then you get everything there is nothing missing.

But the FAE is a select´distinct, if you have a field list with less fields, such that you woould get duplicates, then they will disappear from the result table.

=> choose your field list properly

Siegfried

Read only

Former Member
0 Likes
853

hi

let say..

if itab is the source table having 2 same data

then whiling joining by for all entries at that time the data will fetch from the source is default one or first one

that is why u can avoid the duplicacy.

if u want to populate duplicate value then use innre join.

thanks

sachhi

Read only

Former Member
0 Likes
853

Hi,

If you want to have duplicate data with For all entries

you must avoid to select key field in the select statement.

because of For all entries will removed duplicates data from the current select statement

Cheers

Wiparat