2007 Oct 26 1:53 PM
Hi,
I have a z table in that there is a numeric, non key field with entries 1,2 .....etc.
now my requirement is i have restrict user with out entering duplicate values through sm30.
If user enter duplicate value, then throw a message by allowing the user to change the value.
Thanks in advance,
Sudheer. A
2007 Oct 26 2:03 PM
hi sudheer,
try changing it to a Primary Key.
If cannot change it, u need to change at Function Group, look it:
Regards
Allan Cristian
2007 Oct 26 2:04 PM
Hi
u need to create an exit where u can insert the code to check a duplicate value: after genereting the program for SM30 go to Enviroment->Modification->Events:
here you can indicate the name of the routine has to be triggered to check the duplicate values: you can use the event 05 (Creating a new entry).
Max
2007 Oct 26 2:08 PM
hi Sudeer,
For TMG, u have the screen. The flow logic of the editable. In the PAI event after the Loop--endloop statement.
Do the following:
chain: field (fieldname) module check.
Create the module by double clicking it and write the following code:
Module Check.
Select single * from dbtable into the wa where fieldvalue = fieldvalue from the screen.
If sy-subrc = 0.
Message 'value already exists in the Db' type 'S' display Like 'E'.
Endif.
Endmodule.
Thank you.
Reward points if found useful.