Skip to Content
0
Jul 06, 2009 at 12:47 PM

Optimization for a query for reversal checking.....!

127 Views

Hey experts I have one query...!

in MSEG field lfbnr contains the reference document no.

I want to eliminate the entries which have reversal ....!

like if one( MBLNR 123 with moment 101 has lfbnr null ) and its reversal is ( MBLNR 456 with moment 102 with lfbnr = 123 check ! )

i want to eliminate both

the query will somwhat look like below....athough its not actual....!


 SELECT MBLNR 
      FROM MSEG INTO CORRESPONDING FIELDS OF TABLE IT_MSEG 
                                         WHERE
                                         BWART  = '101'  AND
                                          mblnr not in
                                     ( SELECT lfbnr as mblnr FROM mseg WHERE bwart = '102' ).

above is just an example...just for test....

plz suggest a solution or suggest a aternative for same thing

Thanks in Advance.