2007 Jul 16 10:46 AM
Hi friends,
My selection screen fields are delivery number and item number output contains 4 records but third record contains document type remaining records contains document type as 000.. I need to fetch only third record document type. I wrote the following select query but it is not fetching properly.
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp is not null.
Pl tell me the correct syntax.
Thanks.
2007 Jul 16 10:48 AM
Hello,
Change the code like this.
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp ne space. " Check Here
Vasanth
2007 Jul 16 10:51 AM
First of all thanks but if I put space then it will fetch the records having document type 000 also but I dont want like that I want the record having the document type is greater than zero. If I put 0000 it will take the 00000 record I dont want like that.
Thanks
2007 Jul 16 10:48 AM
Hi
Give the exact value of doc type in where condition.
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp <> '0000'.
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 16 10:56 AM
Hi
You can try like thi s
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp is <> ' '.
Reward all helpfull answers
Regards
Pavan
2007 Jul 16 10:50 AM
hi,
change
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp is not null.
to
Select single doctyp into x_doctyp from dbtable
Where docnum <b>in</b> s_docnum
And itemnumber <b>in</b> s_item num
And doctyp is not null.
2007 Jul 16 10:52 AM
Hi,
Try like this
Select single doctyp into x_doctyp from dbtable
Where docnum = s_docnum
And itemnumber = s_item num
And doctyp NE SPACE.
In the above query it will pick only that record whose doctyp is not equal to space,that menas it has value.
regards,
Nagaraj
2007 Jul 16 12:03 PM
hi bharat
try this.........
select single doctyp from dbtable into x_doctyp
where docnum = s_docnum and
itemnumber = s_item num and
doctyp = '000'.
reward if useful....!!