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: 

mandatory fields in table

Former Member
0 Kudos
880

hello friends,

i had created a custom table and i have maitained table generator also but i am not able to make the fields of the table mandatory.can u please help.

6 REPLIES 6

former_member182190
Active Participant
0 Kudos
248

Hi,

You can make some fields mandatory in the Events associated with table.

Just write code to check whether those fields are initial or not in SAVE_DATA event of your table.

Regards,

Ismail.

0 Kudos
248

Can anyone elaborate more on this?

Former Member
0 Kudos
248

HI,

If you are checking the mandatory field over Data Browser, Then it wont show those fileds are like Mandatory.

Regards,

Suresh

Former Member
0 Kudos
248

U have to tick INITIAL check box in SE11.

Indicator that NOT NULL is forced for this field

Use

Select this flag if a field to be inserted in the database is to be filled with initial values. The initial value used depends on the data type of the field.

Please note that fields in the database for which the this flag is not set can also be filled with initial values.

When you create a table, all fields of the table can be defined as NOT NULL and filled with an initial value. The same applies when converting the table. Only when new fields are added or inserted, are these filled with initial values. An exception is key fields. These are always filled automatically with initial values.

Restrictions and notes:

The initial value cannot be set for fields of data types LCHR, LRAW, and RAW. If the field length is greater than 32, the initial flag cannot be set for fields of data type NUMC.

If a new field is inserted in the table and the initial flag is set, the complete table is scanned on activation and an UPDATE is made to the new field. This can be very time-consuming.

If the initial flag is set for an included structure, this means that the attributes from the structure are transferred. That is, exactly those fields which are marked as initial in the definition have this attribute in the table as well.

Regards

prabhu

Former Member
0 Kudos
248

Hi,

You cant make tables fields as mandatory. There is no uch option for table fileds. But you can initialize them by checking Initial check box.

Thanks,

Nageswar

Former Member
0 Kudos
248

Hi Kanti Rao,

While creating the Z-table, check <b>key</b> check box and <b>initial value</b> check box , so that you can make the required field mandatory. Then go for the Table maintanence generator. Since you have already done table maintanence generator, just make the rewquired changes and once again do the table maintanence generator.

Hope this resolves your query.

Reward All the helpful answers.

Regards

Nagaraj