06-30-2006 7:58 AM
hello sir/mam.
i am selva, i am new to abap,
is it possible to create many primary key for a table?
please guide me.
06-30-2006 8:07 AM
Hi,
A table can span multiple columns if that's the idea behind your question. Check also
http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/384c4005a99523e10000000a1550b0/frameset.htm
PS.
Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
Spread the wor(l)d!
06-30-2006 5:11 PM
07-04-2006 11:53 AM
You can create many primary keys in a table. This becomes combinational primary key. This means, the combination of all primary keys acts as primary key for that table ( combination of data in all primary key field should be unique ).
07-04-2006 12:39 PM
Hi Selva,
A table consist of rows & columns. So, you can define a primary key in several columns in the table.
here you go the example
CREATE TABLE hotel.person
(pno FIXED(6),
name CHAR(20),
city CHAR(20))
Add a primary key:
ALTER TABLE hotel.person ADD PRIMARY KEY (pno,name)
Cheers
Jawahar Govindaraj
PS:Reward pts
07-05-2006 1:52 PM
Hi Selva,
Many Primary Keys = Composite Key.
i.e some set of columns will enable you to identify a unique row from a set of rows in the table.
This can be achieved by checking the primary key check box in se11.
Hope it helps.
Regards,
Maheswaran.B
Message was edited by: Maheswaran B
07-06-2006 7:04 AM
Hi,
Pls don't forget to reward points and close the question if you find the answers useful.
Eddy
PS.
Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
Spread the wor(l)d!