Application Development and Automation 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: 
Read only

validation for records inTable maintaince generator

Former Member
0 Likes
645

Hi friends,

I have created a table ZSTUDENT_INFO. and i have created a table maintaince generator for it....

now i have fields...

ZSCHOOL , ZCLASS , ZNAME , ZAGE , ZROLLNO.

now i have school and class as key fieilds....

now my requiremnet is when the user his entering his records

case 1) for same school and class the roll number is unique ie : we cant have 2 persons with same roll numbers

for example :

school class name age roll no

Adams 4 rahul 8 2

Adams 5 Rahul 9 2

adams 4 kiran 8 2

ist 2 records are differnet ist record is 4thclass and 2nd record is for 5th class but the rd record is same as ist record...

now in this case the user should not able to save the 3rd record as alredy same record is there..

case 2) when the user is entering the record he should check in the table whetther the same combination alredy exits in teh table or not .. if exists it should give us an error mesage saying data already exits..

How can i do this and where should i do this...

Regards

Satish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

Hi,

Add ZROLLNO as primary key the ... Your problem will be solved...

4 REPLIES 4
Read only

Former Member
0 Likes
611

You ' ll need to create an event in the table maintainence generator. Go to Environment --> Modifications --> Events in the table maintainence generator.

Here write a code in the new entries event write a select query on the same table z table where you are writing the code.

Read only

Former Member
0 Likes
611

Hi satish,

First of all if it is a key field system will take care of giving the duplicate record error.

If you want to do any validations in table maintenance generator. Please check the following links or search the forum

with the Table Maintenace Generator events.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-87652872...

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-87652872...

If i misunderstood your requirement, please elaborate the question.

Thanks

Read only

Former Member
0 Likes
611

Hi satish, the best n simplest way for you requirement is.. just make roll number also key field. so when ever there is same combination of school , class and roll number it will reject the entry saying "record already exist..."

Read only

Former Member
0 Likes
612

Hi,

Add ZROLLNO as primary key the ... Your problem will be solved...