‎2008 Oct 22 2:57 PM
Hi,
I have developed a module pool and i use the below query in it. ZFMM_SD51_AUDIT is the table that i created and i am fetching the data from it.
The problem is when i input this data for idocno in selection, it gives me no records from this query although there is a record to the idocno in the table. And when i replace AND with OR in the query it gives me all the records in the table. While debugging i see the record does get shown as input into the selection field but the internal table does not show 1 record as is in the table. Its really confusing whats goin wrong? Is there any sort of setting i need to do for this in the dictionary table or there some other way also for writing the query.
Can any one help on this?
Would appreciate your responses or suggestions. Thanks
SELECT *
FROM zfmm_sd51_audit
INTO TABLE it_final
WHERE ( zidocno = zfmm_sd51_audit-zidocno OR zidocno = c_space )
AND ( zqmnum = zfmm_sd51_audit-zqmnum OR zqmnum = c_space )
AND ( zuser_name = zfmm_sd51_audit-zuser_name OR zuser_name = c_space )
AND ( ( zresolved_date BETWEEN s_date1-low AND s_date1-high ) OR zresolved_date = c_space )
AND ( ( zresolved_time BETWEEN s_time1-low AND s_time1-high ) OR zresolved_time = c_space )
AND ( ( zrdate BETWEEN s_date-low AND s_date-high ) OR zrdate = c_space )
AND ( ( zrtime BETWEEN s_time-low AND s_time-high ) OR zrtime = c_space ) .
Saurabh.
‎2008 Oct 22 3:26 PM
I would suggest building the query from just one WHERE statement and then re-test by adding in the extra criteria. By doing this you should notice yourself which particular field is causing the problem...
e.g. start with this, then build up the statement until it stops working as expected
SELECT *
FROM zfmm_sd51_audit
INTO TABLE it_final
WHERE ( zidocno = zfmm_sd51_audit-zidocno ).
‎2008 Oct 22 3:26 PM
I would suggest building the query from just one WHERE statement and then re-test by adding in the extra criteria. By doing this you should notice yourself which particular field is causing the problem...
e.g. start with this, then build up the statement until it stops working as expected
SELECT *
FROM zfmm_sd51_audit
INTO TABLE it_final
WHERE ( zidocno = zfmm_sd51_audit-zidocno ).