2006 May 31 10:54 AM
Hi..
I have a Doubt in a simple Query from the table NAST.
My query is as follows:--
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp.
Now I want to select all the NAST records which are either not processed (NAST-VSTAT = 0) or incompletely processed (NAST-VSTAT = 2)(the field in the table NAST is VSTAT which denotes the Processing status of message)
So Can I add both the conditions in the WHERE clause of the the above Select Query?
Is there any other optimised way I can do that?
Thanks
Hi..
I have a Doubt in a simple Query from the table NAST.
My query is as follows:--
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp.
Now I want to select all the NAST records which are either not processed (NAST-VSTAT = 0) or incompletely processed (NAST-VSTAT = 2)(the field in the table NAST is VSTAT which denotes the Processing status of message)
So Can I add both the conditions in the WHERE clause of the the above Select Query?
Is there any other optimised way I can do that?
Thanks
2006 May 31 10:59 AM
hi,
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp
and (vstat = 0 or vstat = 2).
hope this helps,
keerthi.
2006 May 31 11:00 AM
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp
and ( vstat = 0 or vstat = 2).
2006 May 31 11:01 AM
u can add the condition to the qury like this
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp.
<b>and ( VSTAT = 0 or VSTAT = 2 )</b>
2006 May 31 11:04 AM
do this way
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp
and <b>( vstat = 0 or vstat = 2).</b>
2006 May 31 11:02 AM
hi,
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp
<b>and ( VSTAT = 0 0r VSTAT = 2 ).</b>
2006 May 31 11:02 AM
Hi,
you can use OR in the WHERE claus eand specify both the conditions.
Regards,
Aswin
2006 May 31 11:07 AM
hi subhash,
Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp.
and<b>( VSTAT = 0 or VSTAT = 2 )</b>
hope this helps,
priya.
2006 May 31 11:17 AM
ranges: r_stat for nast-vstat.
r_stat-low = '0'.
r_stat-option = 'EQ'.
r_stat-sign = 'I'.
append r_stat.
clear r_stat.
r_stat-low = '2'.
r_stat-option = 'EQ'.
r_stat-sign = 'I'.
append r_stat.
clear r_stat.Select kappl
objky
kschl
parnr
parvw
nacha
vsztp
from nast into table vit_nast
where kappl = p_kappl
and kschl in s_kschl
and parnr in s_parnr
and nacha = p_nacha
and vsztp in s_vsztp
<b>and vstat in r_stat.</b>check this..
Regards
vijay
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |