‎2007 Feb 14 7:19 AM
Hi All,
I am having the following select query in the report
SELECT *
FROM zexc_rec INTO TABLE lt_docno
WHERE lifnr IN s_lifnr AND
docno IN s_docno AND
doctyp IN ('CT1','CT1C').
when the value of s_docno is blank , the query is not selecting any rows, I want in the case of blank s_docno ,it should select all the rows with that s_lifnr and any document no..
Please suggest what should be changed for that.
Thanks.
‎2007 Feb 14 7:37 AM
Hi,
the query is correct but some times we may face some problem like this.
IF s_docno[] IS INITIAL.
SELECT *
FROM zexc_rec
INTO TABLE lt_docno
WHERE lifnr IN s_lifnr AND
doctyp IN ( 'CT1', 'CT1C' ).
ELSE.
SELECT *
FROM zexc_rec
INTO TABLE lt_docno
WHERE lifnr IN s_lifnr AND
docno IN s_docno AND
doctyp IN ( 'CT1', 'CT1C' ).
‎2007 Feb 14 7:22 AM
hi,
Your query is correct. Check the DB table if there are entries for your selection criteria.
Regards
Subramanian
‎2007 Feb 14 7:30 AM
Hi,
I don't see anything wrong in ur query.plz check if u have the table entries correctly..ur query is fine...as s_docno is a selectoption so thre shouldn't be
any problem...
Regards,
Nagaraj
‎2007 Feb 14 7:33 AM
I dont see anything wrong in the query . please check there may be problem with the condition "<b>doctyp IN ('CT1','CT1C')</b> " .
‎2007 Feb 14 7:37 AM
Hi,
the query is correct but some times we may face some problem like this.
IF s_docno[] IS INITIAL.
SELECT *
FROM zexc_rec
INTO TABLE lt_docno
WHERE lifnr IN s_lifnr AND
doctyp IN ( 'CT1', 'CT1C' ).
ELSE.
SELECT *
FROM zexc_rec
INTO TABLE lt_docno
WHERE lifnr IN s_lifnr AND
docno IN s_docno AND
doctyp IN ( 'CT1', 'CT1C' ).
‎2007 Feb 14 8:03 AM
Rahul,
there might b no records in the table for this selection criteria. check it in se11.
..MB