‎2007 Sep 24 2:54 PM
HI,
i have to add to this select condition that
vbakvbtype = 'L' <b>JUST WHEN</b> vbakauart = 'YMC0'.
what is the best way to do that?
I REWARD
Regards
SELECT vbak~vbeln vbak~objnr vbak~audat
vbak~netwr vbak~waerk vbak~kvgr3
tvv3t~bezei
FROM vbak LEFT OUTER JOIN
tvv3t ON tvv3t~kvgr3 EQ vbak~kvgr3
AND tvv3t~spras EQ sy-langu
INTO CORRESPONDING FIELDS OF TABLE lt_vbak
WHERE vbak~ps_psp_pnr EQ l_project.
‎2007 Sep 24 2:57 PM
I wouldn't do the check as part of the select but instead do the check while looping the internal table.
‎2007 Sep 24 2:57 PM
I wouldn't do the check as part of the select but instead do the check while looping the internal table.
‎2007 Sep 24 2:58 PM
‎2007 Sep 24 3:07 PM
hi TAL,
I gave you the solution, not just a very helpful answer...
ec
‎2007 Sep 24 3:09 PM
hi eric
its not working well
i wont vbakvbtype = 'L' JUST WHEN vbakauart = 'YMC0'
meaning i <b>dont</b> wont to get vbtype = 'L' when vbak~auart <b>ne</b> 'YMC0'
Regards
‎2007 Sep 24 3:13 PM
TAL,
sorry it is still not clear for me...
if vbakauart = 'YMC0' than you need records where vbakvbtype = 'L'
right?
but, in the opposite? I mean when vbak~auart NOT EQUAL 'YMC0'?
What should be the result?
thanks
ec
‎2007 Sep 24 3:26 PM
hi eric
thankes for your time
i wont just vbtype = 'L'
only for vbak~auart = 'YMC0'
i dont wont any other vbtype = 'L' from table
Regards
‎2007 Sep 24 3:28 PM
than it's simple:
WHERE vbak~ps_psp_pnr EQ l_project AND
vbak~auart EQ 'YMC0' AND
vbak~vbtype EQ 'L'.
‎2007 Sep 24 2:58 PM
hi TAL,
WHERE vbak~ps_psp_pnr EQ l_project AND
( ( vbak~auart EQ 'YMC0' AND
vbak~vbtype EQ 'L' ) OR
( vbak~auart NE 'YMC0' ).
hope this helps
ec
‎2007 Sep 24 3:06 PM
hi eric
i wont vbakvbtype = 'L' JUST WHEN vbakauart = 'YMC0'
meaning i <b>dont</b> wont to get vbtype = 'L' when vbak~auart <b>ne</b> 'YMC0'
Regards
‎2007 Sep 24 3:00 PM
SELECT vbakvbeln vbakobjnr vbak~audat
vbaknetwr vbakwaerk vbak~kvgr3
tvv3t~bezei
FROM vbak LEFT OUTER JOIN
tvv3t ON tvv3tkvgr3 EQ vbakkvgr3
AND tvv3t~spras EQ sy-langu
INTO CORRESPONDING FIELDS OF TABLE lt_vbak
WHERE vbak~ps_psp_pnr EQ l_project
and vbak~vbtype = 'L'
and vbak~auart = 'YMC0'.
or
<b> SELECT vbakvbeln vbakobjnr vbak~audat
vbaknetwr vbakwaerk vbak~kvgr3
tvv3t~bezei
FROM vbak LEFT OUTER JOIN
tvv3t ON tvv3tkvgr3 EQ vbakkvgr3
AND tvv3t~spras EQ sy-langu
INTO CORRESPONDING FIELDS OF TABLE lt_vbak
WHERE vbak~ps_psp_pnr EQ l_project.
if not it_vbak[] is initial.
sort it_vbak by auart.
read table it_vbak with key auart = 'YMCO' binary search.
if sy-subrc = 0.
if it_vbak-vbtype ne 'C'.
delete it_vbak index sy-tabix.
endif.
endif.
endif.</b>
Regards
vasu
‎2007 Sep 24 3:05 PM
hi vasu
i wont vbakvbtype = 'L' JUST WHEN vbakauart = 'YMC0'
meaning i <b>dont</b> wont to get vbtype = 'L' when vbak~auart <b>ne</b> 'YMC0'
Regards
‎2007 Sep 24 3:08 PM
i have to add to this select condition that
vbakvbtype = 'L' JUST WHEN vbakauart = 'YMC0'.
what is the best way to do that?
I REWARD
Regards
loop at lt_vbak into lh_vbak.
if lh_vbak-vbtype <> 'L' or lh_vbak-auart = 'YMC0'.
perform process_data.
endif.
clear lh_vbak.
endloop.