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

Default values for Screen Fileds

Former Member
0 Likes
696

Hi All

By default, if a user doesnt give a value for a particular field, it will have the Default Value of the particular type.But i want it to retain a Null Value in such case. Is it possible.

I have a numeric field in my screen. I need ot trigger a error message if the user doesnt enter any value..

And to accept if ihe enters 0.

BUt even if the user doesnt give any value, the screen field gets 0.

Is there any way to do this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

You might want to check out using the "on request" on some modules in the screen flow to determine if the user has keyed something in... from [Conditional Module Calls|http://help.sap.com/saphelp_46c/helpdata/EN/9f/dbabbd35c111d1829f0000e829fbfe/content.htm] :


ON REQUEST
The module <mod> is only called if the user has entered something in the field. This includes cases when the user overwrites an existing value with the same value, or explicitly enters the initial value. 

Jonathan

Hi All

By default, if a user doesnt give a value for a particular field, it will have the Default Value of the particular type.But i want it to retain a Null Value in such case. Is it possible.

I have a numeric field in my screen. I need ot trigger a error message if the user doesnt enter any value..

And to accept if ihe enters 0.

BUt even if the user doesnt give any value, the screen field gets 0.

Is there any way to do this

4 REPLIES 4
Read only

Former Member
0 Likes
668

Why put a default value in it then?

However..


IF Screen_field = Screen_field_default.
  message err-msg.
  clear Screen_field.
ENDIF.

Read only

0 Likes
668

Try this

Try to use if condition and check

If <F1> = 0

error message.

endif.

If <F1> LE 0

error message.

endif.

Read only

Former Member
0 Likes
668

hi,

use it for null value validation

if <variable> is initial.

error message

endif.

reward if useful

Read only

Former Member
0 Likes
669

You might want to check out using the "on request" on some modules in the screen flow to determine if the user has keyed something in... from [Conditional Module Calls|http://help.sap.com/saphelp_46c/helpdata/EN/9f/dbabbd35c111d1829f0000e829fbfe/content.htm] :


ON REQUEST
The module <mod> is only called if the user has entered something in the field. This includes cases when the user overwrites an existing value with the same value, or explicitly enters the initial value. 

Jonathan