Skip to Content
0
Former Member
Apr 18, 2008 at 02:54 PM

Compound primary key

30 Views

Hello,

I want to make an internal table, that should behandled by a compound primary key. I'm German and I am not sure what's the english word for zusammengesetzter primärschlüssel. I mean I have e.g. 4 Primary Keys. An valid Dataset must have a unique COMBINATION of these 4 Primary keys.SO that's what I am looking for. I tried doing it with a SORTED TABLE:

tabLine TYPE SORTED TABLE OF Line WITH UNIQUE KEY Key1 , Key 2.

But this is not what I want. Now ABAP wants to be each Primary Key to be unique. But I want to have a unique COMBINATION of all Primary Keys to be unique. My next idea is to make "a table in a line" and this will be my primary key. But I am not sure if that would even work and if there isn't a much easier way in ABAP. So I am asking you again 😊

thank you.