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

regarding validating blank fields in custom table maintainance screen

Former Member
0 Likes
1,704

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

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
847

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

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
848

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

Read only

Former Member
0 Likes
847

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.

Read only

Former Member
0 Likes
847

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

Read only

Former Member
0 Likes
847

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