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

Know when select option is empty

Former Member
0 Likes
1,615

Hi abappers,

I want know when the value of several select options are empty.

The code:

IF I1 or I2 or I3 or I4 GE '1'.
   fill = 'X'
END IF.

or

IF I1 or I2 or I3 or I4 IS INITIAL.
   fill = 'X'
END IF.

With this code always fill = X, I used GT '0' too; the values of the select options are empty all except I3 and other that the value are ' 000000' or '0000 ' the value changed in function select option that is used..

Can you help me , please?

Cordial greetings.

3 REPLIES 3
Read only

Former Member
0 Likes
755

HI,

IF YOU ARE USING A CONDIOTION IN 'IF' STATEMENT

IT SHOULD BE LIKE....

if i1 ge '1' or i2 ge '1' or i3 ge '1' or i4 ge '1'.

(your statement)

endif.

similar case when you use any logical condition.

regards

mohit

Read only

Former Member
0 Likes
755

Hi,

Since you want to find when all SELECT OPTIONS is empty,

Use as AND operation,

If I1 IS INITIAL and I2 IS INITIAL and I3 IS INITIAL and I4 IS INITIAL

FILL = 'X'.

ENDIF.

or

If I1 GE 1 and I2 GE 1 and I3 GE 1 and I4 GE 1

FILL = 'X'.

ENDIF.

Read only

Former Member
0 Likes
755

Hi,

If you want to check if a select-options is empty, use the following way :



IF i1[] is initial  OR  i2[] is initial OR
   i3[] is initial  OR  i4[] is initial.
       fill = 'X'.
ENDIF.

With select options you need to use the square brackets because select options are internally stored in internal tables.

Note : The above code will have fill = 'X' even if one of the select option is empty. If you want to check if all select options are empty , then use AND instead of OR

regards,

Advait

Edited by: Advait Gode on Feb 3, 2009 2:42 PM