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 statement

Former Member
0 Likes
554

hello

here is my issue

on bkpf i want to select BUKRS BELNR GJAHR XBLNR AWKEY

here is my where clause

bkpf-xblnr NE bkpf-awkey

and bkpf-xblnr NA '0123456789'.

i mean tosay xblnr data in bkpf should not be equal to AWKEY data in BKPF itself and

XBLNR contains not any '0123456789'.

now how to write my select statement with the above where clause.

if i select all my data based on bukrs on bkpf and laget i can put these statements as if conditions but there is huge performance issue because i dont have proper fields in selection scree.

so i have to put them in the where claue of selet itself.

Edited by: ram reddy on Aug 18, 2008 12:01 PM

3 REPLIES 3
Read only

Former Member
0 Likes
484

Hi ram,

1. Unfortunately open sql does not provide this flexibility.

2.

Where

xblnr NE awkey

we cannot write like the above in select query,

bcos the right side of the equation, we cannot

use the table field itself. It should be some value or variable.

3.

XBLNR contains not any '0123456789'

At most we can use

XBLNR LIKE '%0123456789%'

OR

XBLNR Not LIKE '%0123456789%'

But not sure whether it will give the same meaning.

regards,

amit m.

Read only

RahulKeshav
Active Contributor
0 Likes
484

wt are the selection screen fields do you have...

Read only

Former Member
0 Likes
484

Hi Ram,

Do like this

Ex: your gt_bkpf has the following fields

BUKRS

BELNR

GJAHR

XBLNR

AWKEY

declare another internal table of same type.

eg: gt_bkpf1

select BUKRS BELNR GJAHR XBLNR AWKEY

into gt_bkpf where <Specify conditions here.>

loop at gt_bkpf into wa_bkpf where xblnr <> awkey.

append wa_bkpf to gt_bkpf1.

endloop.

Now you perform depending select-statments using gt_bkpf1.

It will solve your issue.

Regards,

Santosh Kumar M.