2005 Dec 09 4:17 PM
HI all,
I have a question on how to handle to handle Select-Options.
IF some_value IN S_value.
Logic1.
ELSE.
Logic2.
ENDIF.
Problem here is when Select-Option S_value is Empty. It is true for all values in 'some_value'. Is there any easy way to handle it, WITHOUT explicitly checking if the Select-Option IS INITIAL or not, it make my code lot simpler.
Thanks in Advance,
Ravi.
2005 Dec 09 4:26 PM
Without checking the initial condition, I don't think it is possible.
IF NOT s_value[] IS INITIAL
AND some_value IN S_value.
Logic1.
ELSE.
Logic2.
ENDIF.Just added the [] for s_value to check for the internal table not just the header.
If it has to have some value, make it mandatory. You are not going to save anything or improve anything by not adding the INITIAL check.
2005 Dec 09 4:22 PM
Hi Ravi,
Before your IF condition.You can always check for the values in S_value-low & S_value-high,to see whether it is initial or not & then go with your below IF condition.
2005 Dec 09 4:22 PM
Hi,
Why do you want to avoid checking whether select-option is initial. That is the simplest way to handle this.
If you dont want that then my suggestion is use, describe table S_OPTION and get number of lines. You can check whether number of lines is zero or more than zero.
Ex:
data : l type i.
describe table s_option lines l.
if l = 0.
---
else.
---
endif.
Still checking for initial is the best option.
Regards,
Ramesh.
2005 Dec 09 4:22 PM
Ravi,
There is no straight forward way of doing it. Probably you can append a dummy record in the SELECT OPTIONS, a blank record probably. However, you will get only those values that are blank.
Other than that you don't have an option other than checking the SELECT OPTIONS.
Regards,
Ravi
Note : Please reward the posts that help you.
2005 Dec 09 4:25 PM
2005 Dec 09 4:26 PM
Hi
I think you can do it without to check th SO, if your SO is obligatory, if it isn't you should check your SO.
I believe the easier check is:
IF NOT SO[] IS INITIAL.
......
Max
2005 Dec 09 4:26 PM
Without checking the initial condition, I don't think it is possible.
IF NOT s_value[] IS INITIAL
AND some_value IN S_value.
Logic1.
ELSE.
Logic2.
ENDIF.Just added the [] for s_value to check for the internal table not just the header.
2005 Dec 09 4:28 PM
If it has to have some value, make it mandatory. You are not going to save anything or improve anything by not adding the INITIAL check.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |