11-18-2005 10:07 AM
i need to take all the status of "objnr" but there are status that i dont want to see exclude
this is the select that take all the status
select-option: z_stat_i FOR jest-stat,
z_stat_e FOR jest-stat.
SELECT stat
FROM jest
INTO mdstat-zs_stat
WHERE objnr = mdeqp-objnr
AND stat IN z_stat_i
AND inact = ' '.
APPEND mdstat.
any ideas?
thanks
11-18-2005 10:09 AM
11-18-2005 10:11 AM
Hi,
I would think it is as simple as this:
SELECT stat
FROM jest
INTO mdstat-zs_stat
WHERE objnr = mdeqp-objnr
AND stat IN z_stat_i
<b>AND NOT stat IN z_stat_e</b>
AND inact = ' '.
APPEND mdstat.
regards
Thomas
11-18-2005 10:16 AM
i dont think it's so simple
becuase in trans IE05
if you donot write status in-include
and you write status in exclude you get data, is this select catch all the cases???
11-18-2005 10:33 AM
I'm not familiar with IE05. But this select works this way:
If EX is empty you get nothing returned.
If EX has data - this is the only thing you don't get.
If IN has data - this is the only thing you get as long as the result don't match your EX.
To be sure you get all if the EX is empty, you should validate the input before select and make a nonexisting entry in your EX-select-option. Or simply make 2 select-statements: 1 with the EX and 1 without.
Regards
Thomas
11-18-2005 10:38 AM
Hi Please try with the following code snippet.
SELECT stat
FROM jest
INTO mdstat-zs_stat
WHERE objnr = mdeqp-objnr
AND stat IN z_stat_i
AND NOT stat IN z_stat_e
AND inact = ' '.
APPEND mdstat.
clear mdstat.
endselect.
satish
11-18-2005 12:14 PM
Hi yehiel,
1. It is clear that the normal sql statement
won't work in the way we won't.
2. Thats why, some extra logic needs to be applied.
As already mentioned,
The RANGE for EXCLUDE
must be filled with some DUMMY Data.
Just write this CODE
JUST BEFORE CALLING THE SQL.
IF z_stat_eIS INITIAL.
z_stat_e-sign = 'I'.
z_stat_e-option = 'EQ'.
z_stat_e-low = 'XXX'.
z_stat_e-high = 'XXX'.
APPEND z_stat_e.
ENDIF.
HOPE THIS WORKS.
Regards,
Amit M.