‎2007 May 31 5:13 AM
Hi experts.
I need to select sales order line item based on the selection screen input.
In selection screen Rejection reason is used.
I need to exclude the line item which are having the Rejection reason giving in selection screen.
If the the selection screen input is blank then all the records should be selected even the line item has no rejection reason.
I used the following query. But it doesnt work.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency
and (abgru notin s_abgru or abgru eq ' ').
pls help me to do.
‎2007 May 31 5:31 AM
Hi,
if s_abgru is not initial.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency and
abgru Ne s_abgru.
else.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency.
endif.
this will solve your problem.
Regards,
Ruchika
reward if useful.
‎2007 May 31 5:17 AM
Hi,
Try this..
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency
and ( NOT abgru IN s_abgru ).
Thanks,
Naren
‎2007 May 31 5:18 AM
try this..
you have to mention one field in where condition for the table used in for all entries
<b>if not t_vbak[] is initial.</b>
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where <b>field = t_vbrk-field</b> and
waerk ne<b> 'USD'</b> and
(abgru not in s_abgru[] or abgru eq ' ').
<b>endif.</b>
‎2007 May 31 5:18 AM
Hi,
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency
and not abgru IN s_abgru.
when the selct option is blank all the line items will be selected by default..
Regards,
Vidya.
‎2007 May 31 5:21 AM
try this
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where vbeln = t_vbak-vbeln and
waerk ne 'USD'
and not ( abgru in s_abgru or abgru eq ' ' ).
or
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where vbeln = t_vbak-vbeln and
waerk ne 'USD'
and ( abgru not in s_abgru or abgru eq ' ' ).
reagrds
shiba dutta
‎2007 May 31 5:22 AM
select vbeln posnr abgru
from vbap
into table t_vbap
where waerk ne 'USD' and
( abgru not in s_abgru or abgru eq ' ' ).
‎2007 May 31 5:24 AM
hi,
try with this
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd'
and abgru IN s_abgru. [for this you have to declare s_abgru and give value for it].
if helpful reward some points.
with regards,
suresh babu aluri.
‎2007 May 31 5:26 AM
Hi Muru,
Try this
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where vbeln = t_vbak-vbeln and
waerk ne 'USD'
and not ( abgru in s_abgru or abgru eq ' ' ).
Regards,
Line
‎2007 May 31 5:31 AM
Hi,
if s_abgru is not initial.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency and
abgru Ne s_abgru.
else.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency.
endif.
this will solve your problem.
Regards,
Ruchika
reward if useful.
‎2007 May 31 5:34 AM
Hi,
if s_abgru is not initial.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency and
not (abgru in s_abgru).
else.
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'usd' / document currency.
endif.
this will solve your problem.
Regards,
Ruchika
reward if useful.
‎2007 May 31 5:55 AM
HI ALL,
I GOT SOLUTION . Thanks to all.
hi Ruchika Saini i done it from your reply only ya. Thanks a lot.
‎2007 May 31 5:32 AM
hi all i tried all things.
But still it is not working.
SELECT VBELN POSNR MATNR ARKTX ABGRU MEINS NETWR KWMENG VRKME ERDAT
ERNAM ERZET
NETPR STCUR
FROM VBAP
INTO TABLE T_VBAP
FOR ALL ENTRIES IN T_VBAK
WHERE VBELN EQ T_VBAK-VBELN
AND KWMENG NE 0
AND WAERK NE 'USD'
AND ( ABGRU NOT IN S_ABGRU OR ABGRU EQ ' ' ). " i i uncomment this line it will work but not correctlyl
AND NOT ( ABGRU IN S_ABGRU ). " // not picking nothing....no records.
‎2007 May 31 5:37 AM
what you do is
loop at s_abgru.
<b> s_abgru-sign = 'E'.</b> " Excluding
modify a_sbgru index sy-tabix.
endif.
<b>if not t_vbak[] is initial.</b>
SELECT VBELN POSNR MATNR ARKTX ABGRU MEINS NETWR KWMENG VRKME ERDAT
ERNAM ERZET
NETPR STCUR
FROM VBAP
INTO TABLE T_VBAP
FOR ALL ENTRIES IN T_VBAK
WHERE VBELN EQ T_VBAK-VBELN
AND KWMENG NE 0
AND WAERK NE 'USD'
<b>AND <b>ABGRU IN S_ABGRU .</b> " // not picking nothing....no records
endif.</b>
‎2007 May 31 5:41 AM
check in se11 whether any data is present or not for the where condition you have defined . then check in debug mode what is the sy-subrc value it is returning after the select statement...and put a check
if not t_vbak[] is initial.
select...
endif.
reagrds
shiba dutta
‎2007 May 31 5:46 AM
Hi,
use this
select vbeln posnr abgru
from vbap
into table t_vbap
for all entries in t_vbak
where waerk ne 'USD'
and abgru not in s_abgru .
anything in ' ' should be capital
sudha