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

Identical rows in Internal table

Former Member
0 Likes
797

Hi,

How to find if all the records are identical in an internal table.

Eg.I have a internal table itab

The user will enter some 'm' number of records,i need to check if all the records are identical in the internal table.

Could you help me out.

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
778

Do they need to be identical?

You might want to declare an internal (TYPE SORTED TABLE OF) with a unique key. this way you will always have unique records. But when insert data into internal table use the INSERT and NOT the APPEND. This can violate the key and will give a short dump.

Hi,

How to find if all the records are identical in an internal table.

Eg.I have a internal table itab

The user will enter some 'm' number of records,i need to check if all the records are identical in the internal table.

Could you help me out.

4 REPLIES 4
Read only

Sm1tje
Active Contributor
0 Likes
779

Do they need to be identical?

You might want to declare an internal (TYPE SORTED TABLE OF) with a unique key. this way you will always have unique records. But when insert data into internal table use the INSERT and NOT the APPEND. This can violate the key and will give a short dump.

Read only

peter_ruiz2
Active Contributor
0 Likes
778

hi,

use this code.



data: wa_entry type zentry. 

read table itab1 from wa_entry comparing all fields.

if sy-subrc eq 2.
  "True
else.
  "False
endif.

regards,

Peter

Read only

Former Member
0 Likes
778

Hi,

but what is zentry in this code.

data: wa_entry type zentry.

Read only

0 Likes
778

hi,

i use zentry because i don't know the structure of your work area for user entries.

regards,

Peter