Application Development 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: 

select

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

First of all thanks but if I put space then it will fetch the records having document type 000 also but I don’t 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 don’t want like that.

Thanks

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

former_member404244
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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