08-17-2007 1:57 PM
Hi All,
How2 delete a pkey for std table and add 2 new primary key fields .Please provide me the required procedure .
Thanks&Regards.
Bharat.
08-18-2007 2:18 AM
The primary key fields on any standard table will be used in SAP programs, Transactions, view, etc. Changing them in any way will break the SAP code.
If you need data access by a different key - set up an index. Do not change the key.
As another alternative - set up a Z table with the new key you want, and with data fields that include the SAP primary key - you can then use "JOIN" between this and the SAP table to read the data.
Post details of which table you want to do this to and why, to see what others have to say about other ways of achieving your result.
Andrew
08-17-2007 2:10 PM
hi bharat,
u can delete a primary key and add 2 new primary keys...but before that u need to check for these constraints:
1) check whether this table primary key is used in anothe table as foreing key. if so u need to remove this relation.
2) delete all the records from that table.
hope this may help u...
please reward incase usefull...
regards,
prashant
08-17-2007 6:53 PM
Hi Bharat,
First thing is you need to have the access key to change any standard dictionary object/standard programs/ standard transactions.You may get this from your basis person after getting approval from your respective manager.But changing or modifying the standard object is not recommended, but if there is no alternate to meet the business requirement then we have to follow this way only.
Next, you need to check whether this table's primary key is being used in any other table as foreing key or not. If there is, then you must remove this relation and then you can delete the unncessary primary key field from that table.Finally you can add the two new fields and set them as primary key, save, check for any errors and activate.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa
08-17-2007 10:03 PM
I'd like to know based on what requirement you need to change a standard table primary key. That's really ugly...
Have you exausted all other possibilities?
Regards.
08-18-2007 2:18 AM
The primary key fields on any standard table will be used in SAP programs, Transactions, view, etc. Changing them in any way will break the SAP code.
If you need data access by a different key - set up an index. Do not change the key.
As another alternative - set up a Z table with the new key you want, and with data fields that include the SAP primary key - you can then use "JOIN" between this and the SAP table to read the data.
Post details of which table you want to do this to and why, to see what others have to say about other ways of achieving your result.
Andrew