01-18-2008 12:23 PM
hi
i have create one Z table in that i have 3 fileds .
whenever user insert the data 2 fileds data should be unique.
the table i have created as below .
Z_CABJN Z_VBELN Z_POSNR
x 1000 10
y 1000 20
z 1000 30
my table shou not accept
x 1000 40
for ever change of Z_VBELN / Z_POSNR i sholud have new
Z_CABJN.
01-18-2008 12:40 PM
hi Purva Kathuria ,
you can do one thing make the two fields as primary key then your problem will solved
Regards,
sree.....
Reward points if help full
01-18-2008 12:41 PM
Hi Purva,
Hi,
Go to SE11 enter table name ->change
Utilities-> Table Maintenance Generator
delete the Table maintenance by pressing delete button on menu,
then start creating it again.
Enter Auth.Group as &NC&
Enter function group < some name>
Maintenance Type -> One step
Overview screen -> some Number (1 or 2)
Press create
enter dev class and save, activate.
Go to SM 30 and check again.
kindly reward if found helpful.
cheers,
Hema.
01-18-2008 2:09 PM
Hi Purva Kathuria,
Your question is not so clear, as i understood you need the following.
The entries in fields Z_CABJN, Z_POSNR should be unique.
If it is so, below is the answer.
Mark the fields Z_CABJN Z_POSNR as primary key.
So that the entries in those fields will be unique.
I think this is the correct answer to your question.
If, don't forget to reward.
Regards,
Balaram
01-18-2008 6:05 PM
hi purva,
If u want any fields as unique, then make those fields as primary fields.
To make a field as primary, just click on the check box beside to the field name in the ztable.
regards.
shashikanth naram.
01-18-2008 6:12 PM
You can create a secondary index on just those two fields and specify that it is a unique undex.
Rob
01-21-2008 6:26 AM
Dear Purva,
Make Z_CABJN and A_POSNR as Primary keys and then use MODIFY statement. If the user makes an entry and if it doesnt exist then it will make a new entry in the database table and if it already exists then it will modify the existing entry.
Regards,
Tejomayi.