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

Restricting blank entry in table

Former Member
0 Likes
2,844

Hi All,

how to resctrict the blank entries in key field of the table? i.e if user leaves one of the key fields blank while creating the entry it should not allloe so.

Please reply

Regards

Saurabh

Hi All,

how to resctrict the blank entries in key field of the table? i.e if user leaves one of the key fields blank while creating the entry it should not allloe so.

Please reply

Regards

Saurabh

6 REPLIES 6
Read only

Former Member
0 Likes
1,633

Hi,

While inserting records in the table, SAP by default checks that you supply all the key fields with a value.

You can not keep the key fields blank.

Regards,

Amit Mishra

Message was edited by: Amit Mishra

Read only

0 Likes
1,633

Amit,

That is not a true statement. SAP does not validate that all key fields have been filled.

Saurabh,

You will need to add screen validations in your code. Something like:

if the_current_field is initial.

message i000 with 'Please enter a value'.

exit. "to prevent the DB update from occurring

endif.

Read only

0 Likes
1,633

Hi Saurabh,

I am sorry, I was wrong here. SAP dosn't do the validation for the blank fields.

You will have to explicitly do that by providing validation for the same.

Incase, the table is Z* table you can write the code for doing this in TABLE MAINTENANCE GENERATOR.

Goto Utilities --> Table Maintenance Generator.

Regards,

Amit Mishra

Read only

Former Member
0 Likes
1,633

Hi ,

Yes as John has mentioned atleast one EMPTY entry for the key fields can be made if there is no validation.

SAP does not provide std validation.

You can write events to handle the validation for your custom tables.

CHeers

VJ

Read only

Former Member
0 Likes
1,633

Saurabh,

If you need more clarification, please provide more info.

Otherwise, please reward points accordingly and close the thread.

Read only

Former Member
0 Likes
1,633

tx