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

Re: Code for fetching MSEG-DUBMTR data positive/negative in Query

$
0
0

Hi Zaiedul Hoque,

                              First of all there is no need for a JOIN between MSEG and MKPF.

 

Then for you selection of DMBTR and MENGE pls do,

 

DATA: BEGIN OF it_temp,

             dmbtr TYPE dmbtr,

             menge TYPE menge,

           END OF it_temp.  

 

CASE mwart.

 

     WHEN 101 OR 918 OR 919 OR 262 OR 602.

 

          SELECT dmbtr menge FROM mseg INTO it_temp WHERE bwart = (101, 918, 919, 262, 602).

 

     WHEN 102 OR 917 OR 920 OR  261 OR 601.

 

          SELECT dmbtr menge FROM mseg INTO it_temp WHERE bwart = (102, 917, 920, 261, 601).

         

           LOOP AT it_temp INTO wa_temp.

 

                wa_temp-bmbtr = wa_temp-dmbtr * -1.

 

                  wa_temp-menge = wa_temp-menge * -1.

 

 

                  MODIFY it_tempFROM wa_temp INDEX sy-tabix.

                 

            ENDLOOP.  

 

ENDCASE.

 

HOPE THIS HELPS.

 

Happy Coding,

Santhosh Yadav


Viewing all articles
Browse latest Browse all 8635

Trending Articles



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