‎2009 Oct 26 9:06 AM
Hello Experts,
I am trying to validate the data entered in a view for any update or for a new entry created. The validation is if FIELD1 is filled FIELD 2 should be filled as well.
The maintenance is in two steps. Overview screen and Detail screen for new entry.
I used 2 methods
1) Form routine for Table maintenance generator event 01-Before saving data in the database
The Issue with this method was that on encountering this error, it comes out of the list view and shows the error on the previous page status bar. Which basically prevents the user from doing any edit and the data is lost!!!
2) Added a new module in the PAI of the maintenace source code
The error message is displayed in the list screen in DISPALY mode. The screen has only CANCEL and CONTINUE.
If an ENTER or CONTINUE is done it stays on that page in display mode.
If the CANCEL is pressed, the popup asking for confirmation comes and once confirmed, the screen opens for EDIT!!!!!!!!
Again if the CANCEL is pressed, the popup for SAVE comes and if required the control allows to save the data in a TR. Thus no validation is happening, because it evens allows to save wrong data.
Please help me with a method where I get an error message on the same list screen and it is possible to Change and SAVE. With that I mean like the standard SAP works.
‎2009 Oct 26 9:11 AM
Hi you can make use of table maintenance events.
Choose the appropriate event and code it.
Go through this link
link:[https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/8129f164-0a01-0010-2a8e-]
‎2009 Oct 26 10:41 AM
If you read my query, I have mentioned that I used the event 01. The issue is post using it.
Could you suggest a different effective approach than what I used?
Thank you
Anoop
‎2009 Oct 26 11:10 AM
Sorry for the wrong reply,
Do provide the code you have written in PAI for validation.
‎2009 Oct 26 12:50 PM
You need two events for this:
05: F_CHECK_NEW_ENTRY
AA: F_CHECK_FIELD
at 05: you give an error message if the table structure is filled with wrong data. (This is for new entry)
at AA: F_CHECK_FIELD
You need to select data and restrict them to allowed data here.
IF user cant select wrong data and cant create wrong data then you dont need to worry about them changing wrong data.
‎2010 Jan 27 11:02 AM
Thanks for the effort guys..
I have made the changes to the PAI code of the maintenance screens using the CHAIN ENDCHAIN approach