Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to optimize code and Improve performance

Is there any way to improve the performance and optimize the coding.

SELECT mblnr mjahr zeile mat_kdauf mat_kdpos matnr kdauf kdpos menge
       FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
         FOR ALL ENTRIES IN itab
           WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.
  ENDIF.
  SORT imseg BY kdauf kdpos matnr .
  LOOP AT itab.
    LOOP AT imseg WHERE kdauf = itab-vbeln AND
                        kdpos = itab-posnr. "

      itab-trfr_stk =  itab-trfr_stk + imseg-menge.
    ENDLOOP.
    itab-balqty = itab-kwmeng - ( itab-rfmng + itab-kalab + itab-trfr_stk ).
    MODIFY itab ."TRANSPORTING trfr_stk balqty itab.
  ENDLOOP.

Moderator message - Please see the thread at the top of this forum: Please Read before Posting in the Performance and Tuning Forum . You must show some evidence that there is a performance problem and that you have put in some effort to find where that problem is.}

Edited by: Rob Burbank on Apr 20, 2009 9:33 AM

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question