05-17-2011 2:05 PM
Hi,
I have a field with value '----' or '--+'. I want to check the values of the field with:
IF field cn '+-'.
*go on with further process.
ENDIF.
what I want to have is that only values are consider which have not only '+-' as field value.
the problem is that he ignore the cn expression, so if my field has a value of '-' it jumps in the if expression?
Any idea how to solve this problem?
thanks a much.
05-17-2011 2:21 PM
Not able to understand correctly, what you requirement is, but it appears to be a string evaluation.
Use the following:
IF field cn '+-'.
do nothing
else.
*go on with further process.
ENDIF.
If you want specific to '+-' selections, use SEARCH and sy-fdpos as well.
Regards,
Verma
05-17-2011 2:21 PM
Not able to understand correctly, what you requirement is, but it appears to be a string evaluation.
Use the following:
IF field cn '+-'.
do nothing
else.
*go on with further process.
ENDIF.
If you want specific to '+-' selections, use SEARCH and sy-fdpos as well.
Regards,
Verma
05-17-2011 2:28 PM
Hello Santosh,
for better understanding an example:
I have 1 field with several values and an internal table itab:
field = 'abc+'
field = '--'
field = '+'
so when I execute the if expression
if field cn '+-'.
*add field to my internal table.
endif.
so after the 3 fieldvalues in my table I would like to have only a row with value 'abc' as this value not only contains '' or '-'.
05-17-2011 3:10 PM
So where is the problem?
field = 'abc+'
Here condition is TRUE, because operand1 contains abc apart from + and -
field = '--'
Here condition is FALSE, as operand1 contains only characters + and -
field = '+'
Here condistion is FALSE too, as operand1 contains only character +
Your condition will pass only first case, so you already have the solution.
Regards
Marcin
05-17-2011 3:13 PM
The problem is that he pass all 3 cases so in my table I have all 3 values.
05-17-2011 3:13 PM
The problem is that he pass all 3 cases so in my table I have all 3 values.
05-17-2011 3:24 PM
You have declared your fieds as character with a length greater than 4 (or 1) and so it is looking at the trailing spaces. Declare your fields as string.
Rob
05-17-2011 3:29 PM
05-19-2011 11:32 AM
Hello Mr.Marcin Pciak I need a small help redarding selection in one zprogram.
So if possible udate your bussiness card with your m id so that i can send you my zprogam.
thanks in advance.
Thanks and regards.
koolspy.
05-19-2011 2:20 PM
Koolspy - the forums are not a free consulting service or a school where you can expect individual help. It is a collaborative workspace.
So, if you have a problem, start a new thread.
Rob