Skip to Content

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

Code Performance use mseg table

way of best performance of below code.

LOOP AT itab.

CLEAR wa_d_wt.

SELECT * FROM mseg WHERE matnr EQ itab-o_matnr AND charg EQ itab-o_charg AND

( bwart = '601' OR bwart = '641' OR bwart = 602 OR bwart = '642' ).

IF mseg-bwart = '601' OR mseg-bwart = '641'.

wa_d_wt = wa_d_wt + mseg-menge.

ELSE.

wa_d_wt = wa_d_wt - mseg-menge.

ENDIF.

ENDSELECT.

IF wa_d_wt IS NOT INITIAL.

itab-d_wt = wa_d_wt.

MODIFY itab INDEX sy-tabix TRANSPORTING d_wt.

ENDIF.

endloop.

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