Application Development 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: 

Make field in table mandatory

Former Member
0 Kudos

Hi,

I have a character field in a table and need to make it mandatory ( i cant make it a key field). The flag 'initial' only ensures that the field will be populated by the default initial value of the data type. I need to ensure that it have some value. How can i do this?

Regards,

Hari.

8 REPLIES 8

Former Member
0 Kudos

Hi Hari,

How are you maintaing this table. How are you inserting data into this table? Is there a custom program or are you using SM30 table maintenance?

ashish

former_member927251
Active Contributor
0 Kudos

Hi Harikrishnan,

you can do it programatically using table maintenance generator. Just open the table, goto Utilities -> Table Maintenance Generator. Specify a function group, package, screen number and click on the source code. Here you can write the code for ensuring that this field is populated with a value other than the initial value for the data type.

Please reward some points if it helps.

Regards,

Amit M. Mishra

0 Kudos

Hi Amit,

Unfortunately we are using a Z program to do a direct data base update to populate this table. Is there anything at the data definition level where i can control this?

Regards,

Hari.

0 Kudos

In that case you can add validation in this Z program which will check field values and will update if it contains data. Else it will populate error log and this can be displayed in output.

0 Kudos

Thanks again, that is an option, but i wanted a control at the data base level as i want to restrict any future Z programs that may update this table.

0 Kudos

Hi Hari,

Goto DD03L table , there is one field MANDATORY which indicates that a field is mandatory in that table.

i had checked one entry which is mandatory and from the F1 help of that field i came to know that making a field mandatory is obsolete. I am into 4.7

just and R&D , i am not sure

0 Kudos

Hi Sekhar,

I am also in 4.7.

0 Kudos

At the domain level, you can assign individual values, or ranges of values. Select the value tab of the domain and you will see what I mean.

If you choose to do this, you'll probably want to create a new domain to associate with the data element that is assigned to the field of the database table. You want to make sure that any values you assign to the domain will cover the entire range of possible values you want the field to contain.

Bruce