‎2009 Jan 08 8:48 PM
can any one tell me how to validate blank fields in custom table maintainance screen
for ex: when i click new entries and without entering any values if i click on save button it is showing values saved
here actually it should show errors as ' blank values not allowed'
i have tried with event unfortunately once error message is displayed
save button is not shown it became grey button
any solution please
‎2009 Jan 08 9:01 PM
No need to use the Events to validate only mandatory entries.
You can set it in the field's properties in the Screen.
Open your Table Maintenance in SE11
Environment> Modification > Maintenance Screens
Select Your Screen
Open Screen Painter
Select your field and make it required.
Save and Activate.
Note: This change will go away if you regenerate your table maintenance.
Regards,
Naimesh Patel
‎2009 Jan 08 9:01 PM
No need to use the Events to validate only mandatory entries.
You can set it in the field's properties in the Screen.
Open your Table Maintenance in SE11
Environment> Modification > Maintenance Screens
Select Your Screen
Open Screen Painter
Select your field and make it required.
Save and Activate.
Note: This change will go away if you regenerate your table maintenance.
Regards,
Naimesh Patel
‎2009 Jan 09 3:56 AM
Hi Vijay,
Go to SM30 transaction and enter the table name. In the second screen where u will enter the data, go to sytem->status in the menu bar and get the program name and screen number. Go to se51(Screen Painter) and write code in the PAI module for field which u want to validate.
Regards,
Chinna.
‎2009 Jan 15 8:02 AM
Hi,
To avoid saving blank entries, go to the view maintenance screen layout.
Go to the screen painter properties of the field where you do not want blank entries.
In the attributes section, goto "Program". Set the "input" property to "required".
This will throw an error message if the blank is entered in the field.
Regards,
Varsha
‎2009 Jan 15 12:35 PM
hi,
There are two ways to validate entries in a field
1. through code.
2.through attributes for the field in the screen painter
in code...
-> if screen 1 has two buttons "save" and "new entry" ,
-> when new entry is clicked u initialize all the text fields(id ,name,branch).if its numeric field initialise it to 0 else simply ' ' .
-> when save is clicked ,
if ID = 0.
display message "enter id".
elseif NAME = ' '.
display message 'enter name '. // display such message for all fields.
else.
store screen values into itab.
INSERT INTO <table name> VALUES ITAB.
if SY-SUBRC = 0.
display message "successfully updated"
else.
display message " user already exists"
ENDIF.
intialize the text fields in the screen .
endif.
2. Set the attribute " input " for the text field in screen painter to "required".
Hope the content is usefull..Please close the thread if its resolved
Edited by: Rajeshwari padmanaban on Jan 16, 2009 11:26 AM
Edited by: Rajeshwari P on Jan 20, 2009 12:25 PM