‎2015 May 07 2:07 AM
This is killing me and I am sure that it is something simple but for some reason, I can't get it to work.
I have a select options field. I need to compare it to a field from a structure. For some reason, even though the if should work, it is not working. What can the problem be?
IF structure-field NOT IN select_options.
delete something.
Endif.
‎2015 May 07 2:12 AM
Hi Car
I'm sure someone may have a better response.
But my option would be to loop through select_options and perform your check on each entry.
If at the end of the loop, the required condition is met/not met, perform your deletion of the "Somethings"
Regards
Arden
‎2015 May 07 2:19 AM
Hi Car,
There's absolute no reason this IF doesn't work, so my guess is it works, but your content is "problematic". Please share the actual contents of the structure field AND the select-options and we might help.
Cheers,
Custodio
‎2015 May 07 2:23 AM
The only thing we are doing to the value entered is adding leading zeroes to it since that is how the table is saving the data. This could be a problem? When I debug, the value in the table and the value from the select options is the same (with the leading zeroes both) so I don't know why it is failing.
‎2015 May 07 3:18 AM
If the values are the same probably not the problem but I insist, if you share the EXACTLY values (including sign, option, low and high for select-options) it would be easier for us to help.
‎2015 May 07 3:39 AM
The select options has IEQ000714 and the value in the table is 000714.
‎2015 May 07 3:59 AM
So that's why the IF "is not working" (actually it is).
IF structure-field (000714) NOT IN select_options (Include equal 000714).
Obviously it will not get into the if.
you can fix it 3 ways:
- use EEQ00714
- use INE000714
- use IF structure-field NOT IN select_options.
Cheers,
Custodio
‎2015 May 07 4:26 AM
My problem is that it is entering the delete statement when they are the same. My code is like your third suggestion.
IF structure-field NOT IN select_options.
delete
ENDIF.
It should not enter when they are the same.
‎2015 May 07 4:53 AM
Sorry, I meant to say IF structure-field IN select_options.
Anyway, is this value IEQ00714 in the select-option header line only or as a line in the select option "internal table" (it should be).
‎2015 May 07 5:37 AM
Hi Car,
please check, that there is always '000714', Because 'OOO714', 'O00714' ... may look like it.
Please check the hex content of the structure field and the select option in debugger. Are they identical?
Regards,
Klaus
‎2015 May 07 12:45 PM