Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select query problem

Former Member
0 Likes
328

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
294

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 ).

1 REPLY 1
Read only

Former Member
0 Likes
295

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 ).