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

Re: move-corresponding fields in loop

$
0
0

Hi Ganapathi,

 

             In the last piece of code(below), does wa_collect1 contains all the required records?

Also the where condition of the READ statement should be from WA4. Does the records contain same PO's? In that case then you should consider another WHERE condition also otherwise the same PO will be read.

 

Why are you clearing WA_COLLECT1 within the loop?

 

 

LOOP at wa_collect1.

 

MOVE-CORRESPONDING WA_COLLECT1 TO WA4.

 

   READ TABLE IT2 INTO wa2 WITH KEY ebeln = wa2-ebeln.

 

    IF SY-SUBRC = 0.

 

       wa4-rlwrt = wa2-rlwrt.

       wa4-aedat = wa2-aedat.

       wa4-werks = wa2-werks.

       wa4-menge = wa2-menge.

       wa4-dmbtr = wa2-dmbtr.

       wa4-name1 = wa2-name1.

       wa4-belnr = wa2-belnr.

       wa4-budat = wa2-budat.

 

       ENDIF.

 

        APPEND wa4 to it4.

 

        CLEAR : wa4,wa2,WA_COLLECT1.

 

 

ENDLOOP.

            

 

Please check the points I mentioned and let me know.

 

Also I have few suggestions to your program:

 

1) DELETE ADJACENT DUPLICATES FROM it1 COMPARING ALL FIELDS. - Can you please make this before the loop.

 

2) Also if you can try to avoid SELECT ENDSELECT stmts. Instead select the required data outside the loops of it1 and it3 and place the datas into another internal table and then read from the internal table within the loop.

 

 

The second point is a performance issue its just up to you if you want to rectify so in future there won't be any performance issues

 

Thanks & Regards,

Jenny


Viewing all articles
Browse latest Browse all 3193

Trending Articles



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