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: 

key in table

Former Member
0 Kudos

Is it advicable to make all the fields in a table as key? The case is to maintain a control table where 2 fields are required and it should be unique also. is there any thing wrong in doing it?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can, but why? IF you know all of the key fields, there's nothing that the database can tell you when you select it.

Rob

7 REPLIES 7

Former Member
0 Kudos

Well in your scenario, where you have only two fields in tables, and they need to be unique..Yes u can make it. As I also develop a screen in which we have to store two dates as a key in table...

Hope this’ll help you .

Bye

0 Kudos

Thanks Javed,

I was checking whether its a good practice to do making all the fields in table as key.

0 Kudos

I see no problem there, if you had a lot of fields in your table and you tried to make them all keys, you would get an error because there is a limit. No problem here though.

Regards,

Rich Heilman

Former Member
0 Kudos

You can, but why? IF you know all of the key fields, there's nothing that the database can tell you when you select it.

Rob

0 Kudos

hi Rob,

I wanted to record whether a particular transaction has occured or not. If ocuured on the same date it should not be allowed once again. So the transaction and date are my only fields and only keys. Is there any SAP tables with all the fields as key.

0 Kudos

I figured that out right after I made the post. I don't know of any tables like that, but it shouldn't be a problem. You might want to add the client as the first key field.

Rob

0 Kudos

There are lots of SAP tables like this - TB040 for instance.

Rob