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

Do not allow blank values for key fields

Former Member
0 Likes
4,540

Hi all,

I have a table for which the key fields cannot be blank. I read in the forum that in the table maintenance generator i need to code. Can any one please tell me where in the following code i need to write that code...The highlighted fields are key fields.

process before output.

module liste_initialisieren.

loop at extract with control

tctrl_zfpbtc cursor nextline.

module liste_show_liste.

endloop.

*

process after input.

module liste_exit_command at exit-command.

module liste_before_loop.

loop at extract.

module liste_init_workarea.

chain.

<b> field zfpbtc-kostl .

field zfpbtc-bukrs .</b>

field zfpbtc-z3pr .

field zfpbtc-zbtc .

field zfpbtc-aedtm .

field zfpbtc-uname .

module set_update_flag on chain-request.

endchain.

field vim_marked module liste_mark_checkbox.

chain.

field zfpbtc-kostl .

field zfpbtc-bukrs .

module liste_update_liste.

endchain.

endloop.

module liste_after_loop.

-Thanks

Pranati

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,210

If the user can only maintain this table using the screens created by table maintenance generator, then you can add foreign key relationship to the key fields. Once you have that, there will be no need to code your own check.

If you have to code your own check, then in table maintenance generator go to menu environment -> modifications -> events. Create events 05 and 21 pointing to same form routine. In that routine, you can add your check.

Regards,

Raj

Hi all,

I have a table for which the key fields cannot be blank. I read in the forum that in the table maintenance generator i need to code. Can any one please tell me where in the following code i need to write that code...The highlighted fields are key fields.

process before output.

module liste_initialisieren.

loop at extract with control

tctrl_zfpbtc cursor nextline.

module liste_show_liste.

endloop.

*

process after input.

module liste_exit_command at exit-command.

module liste_before_loop.

loop at extract.

module liste_init_workarea.

chain.

<b> field zfpbtc-kostl .

field zfpbtc-bukrs .</b>

field zfpbtc-z3pr .

field zfpbtc-zbtc .

field zfpbtc-aedtm .

field zfpbtc-uname .

module set_update_flag on chain-request.

endchain.

field vim_marked module liste_mark_checkbox.

chain.

field zfpbtc-kostl .

field zfpbtc-bukrs .

module liste_update_liste.

endchain.

endloop.

module liste_after_loop.

-Thanks

Pranati

3 REPLIES 3
Read only

Former Member
0 Likes
2,211

If the user can only maintain this table using the screens created by table maintenance generator, then you can add foreign key relationship to the key fields. Once you have that, there will be no need to code your own check.

If you have to code your own check, then in table maintenance generator go to menu environment -> modifications -> events. Create events 05 and 21 pointing to same form routine. In that routine, you can add your check.

Regards,

Raj

Read only

0 Likes
2,210

Hi Rajendra,

i used event 05 to write the code..

Thanks for your help...

Pranati

Read only

Former Member
0 Likes
2,210

it seems to be a customized table which you have created. You can un-tick the Initial Value Checkbox in the table declaration in SE11 and reactivate the table.

hope this will help

bbye tac care

Ashwani