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

Validate entries in maintenance view : Error message creating problems

Former Member
0 Likes
2,243

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.

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,022

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-]

Read only

0 Likes
1,022

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

Read only

0 Likes
1,022

Sorry for the wrong reply,

Do provide the code you have written in PAI for validation.

Read only

Former Member
0 Likes
1,022

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.

Read only

Former Member
1,022

Thanks for the effort guys..

I have made the changes to the PAI code of the maintenance screens using the CHAIN ENDCHAIN approach