12-12-2012 9:25 AM
Hi,
Created Ztable with 2fields, ( F1 and F2) and created TMG and Tcode
need to validate F2 value is available on another table or not when press SAVE button.
Write logic in PAI... when save it is triggering error
Probelm:
When press enter its accepting value and when press SAVE throwing error but fileds are in disable mode to change.
if multiple values also it should work.
i tried with event but i will get multiple values to to get values from screen.
wrote for one filed but given dump for dynprogram invalid
any solution...
12-12-2012 9:33 AM
Hi R K,
What do you mean by "multiple values to get values from screen"? I think in one of the structures you do get the current value also.
Regards,
KA
12-12-2012 9:36 AM
You have created TMG so use events of TMG. Use 01 event (before saving data to database) and write a select statement to check whether the value exists in another table and display message if not.
suggestion: If you just want to check whether the value exists in another table just make that field as foreign key field for that check table in which you want to check the value. This will not allow any other value except the value present in other table to save.
12-12-2012 9:42 AM
hi,
Check your code if there s any inconsistancy.
better to use foreign key relation to the field F2.
12-12-2012 10:21 AM
Hello RK,
I think you need to do loop at screen command and then enable the field for change.
I am assuming that you have used select single or select up to one rows achieve this requirement.
Where have you written your code ? on TMG events or on Function Group?
Regards,
Deepti
12-12-2012 11:08 AM
Hi,
If you just need to check if value is available in another table for the field, Why cant you do a foreign key check?
Why do you need to add it to an event?