‎2008 Aug 18 11:00 AM
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
‎2008 Aug 18 11:06 AM
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.
‎2008 Aug 18 11:12 AM
‎2008 Aug 18 12:36 PM
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.