Application Development 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: 

Internal table Key fields

shadab_sk
Participant
1,134

Hi Experts,

Is there any way to adopt the key of database table into internal table without explictly specifying all the key fields in the internal table declaration like

data <itab> type standard table of <dbtable> with <key=> it should be all key fields of database table>.

Say i have 10 key fields in database table and i dont want to declare them explictly, is there any specific key word which will automatically bring the keys fields into the internal table.

Thank You,

Shadab

1 ACCEPTED SOLUTION

pfefferf
Active Contributor
522

No, there is no such functionality.

To avoid coding the stuff again and again, you can of course create a DDIC table type with the key defintion. Of course, you have to replicate the key definitions one time again, but then you have at one central position in the ABAP layer at least.

3 REPLIES 3

pfefferf
Active Contributor
523

No, there is no such functionality.

To avoid coding the stuff again and again, you can of course create a DDIC table type with the key defintion. Of course, you have to replicate the key definitions one time again, but then you have at one central position in the ABAP layer at least.

matt
Active Contributor
522

Maybe someone could write a program to make such a type. But it would be a wonderful addition to ABAP to have it part of the language. horst.keller

matt
Active Contributor
0 Kudos
522

No.

But we wants it, my precious. We wants it. Specifically when I'm create a test double for db accesses (pre 7.52).