Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9080

Re: union in a select

$
0
0

If you want to get the output using multiple queries, you can apply the following logic.

 

Tables sapsr3.

data s_matnr type range of matnr WITHHEADERLINE.
data : beginof i_matnr OCCURS0,
       matnr type matnr,
     endof i_matnr.
data i_tab typetableof
sapsr3.


selectDISTINCT matnr  into CORRESPONDING FIELDSOFTABLE i_matnr  from
sapsr3

CLIENTSPECIFIEDwhere mandt = 300 AND werks = '1100' AND stlan = '1' AND stlal = '01'.


  loopat i_matnr.
    s_matnr-sign = 'E'.
    s_matnr-option = 'EQ'.
    s_matnr-low = i_matnr-matnr.
    append s_matnr.
endloop.

select * from
sapsr3 CLIENTSPECIFIEDintotable i_tab

            WHERE mandt = 300 AND werks = '1100'  AND stlan = '1' AND stlal = '02'


delete i_tab where matnr in s_matnr.

select * from
sapsr3 CLIENTSPECIFIEDappendingtable i_tab

          where mandt = 300 AND werks = '1100' AND stlan = '1' AND stlal = '01'.


Viewing all articles
Browse latest Browse all 9080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>