‎2006 Nov 17 9:51 PM
I am using ranges here,
Based on the ranges I have my select statement and I want to exclude everything in the ranges for PSTYV. But It is not excluding, rather it is selecting. I see 'ZTAP in my output.
Any suggestions,.
r_pstyv-sign = 'I'.
r_pstyv-option = 'EQ'.
r_pstyv-low = 'ZTAP'.
APPEND r_pstyv.
r_pstyv-low = 'ZCCR'.
APPEND r_pstyv.
SELECT vbrk~vbeln
vbrp~posnr
vbrp~uepos
vbrp~aupos
vbrk~kunrg
vbrk~kunag
vbrk~fkdat
vbrk~knumv
vbrp~fkimg
vbrp~netwr
vbrp~pstyv
vbrp~aubel
vbrp~matnr
vbrk~vkorg
vbrk~vtweg
vbrk~spart
INTO TABLE it1_vbrk
FROM vbrk
INNER JOIN vbrp
ON vbrkvbeln EQ vbrpvbeln
WHERE vbrk~vkorg EQ p_vkorg
AND vbrp~pstyv NE r_pstyv
AND vbrk~erdat IN s_erdat.
Thanks ain advance.
‎2006 Nov 17 10:30 PM
Hi,
Try this..
IF <b>NOT it1_vbrk-pstyv IN r_pstyv</b>
if the pstyv is ZTAP and ZCCR then condition will be true..
ENDIF.
THanks,
Naren
‎2006 Nov 17 9:56 PM
You need to use IN with the range r_pstyv in your where clause. If you are trying to exclude ZTAP and ZCCR you need to populate the range like this:
r_pstyv-sign = 'E'.
r_pstyv-option = 'EQ'.
r_pstyv-low = 'ZTAP'.
APPEND r_pstyv.
r_pstyv-low = 'ZCCR'.
APPEND r_pstyv.
‎2006 Nov 17 9:57 PM
Hi,
Changes are marked in bold..
r_pstyv-sign = '<b>E</b>'.
r_pstyv-option = 'EQ'.
r_pstyv-low = 'ZTAP'.
APPEND r_pstyv.
r_pstyv-low = 'ZCCR'.
APPEND r_pstyv.
SELECT vbrk~vbeln
vbrp~posnr
vbrp~uepos
vbrp~aupos
vbrk~kunrg
vbrk~kunag
vbrk~fkdat
vbrk~knumv
vbrp~fkimg
vbrp~netwr
vbrp~pstyv
vbrp~aubel
vbrp~matnr
vbrk~vkorg
vbrk~vtweg
vbrk~spart
INTO TABLE it1_vbrk
FROM vbrk
INNER JOIN vbrp
ON vbrkvbeln EQ vbrpvbeln
WHERE vbrk~vkorg EQ p_vkorg
AND vbrp~pstyv <b>IN</b> r_pstyv
AND vbrk~erdat IN s_erdat.
Thanks,
Naren
‎2006 Nov 17 10:03 PM
‎2006 Nov 17 10:26 PM
Friends, It solved my previous problem but has created another problem.
I was usinf this piece of code before but i dont want to erase it, but I dont want to be succesful any time.
But i see that this condition is succesful now.
IF it1_vbrk-pstyv EQ r_pstyv.
Any suggestions,
Shejal.
‎2006 Nov 17 10:30 PM
Hi,
Try this..
IF <b>NOT it1_vbrk-pstyv IN r_pstyv</b>
if the pstyv is ZTAP and ZCCR then condition will be true..
ENDIF.
THanks,
Naren
‎2006 Nov 17 10:38 PM