Skip to Content
Former Member
May 21, 2007 at 04:27 AM



Hi friends,

LOOP AT it_batch.

x_tabix = sy-tabix.

SELECT SUM( clabs ) SUM( cumlm ) SUM( cinsm ) SUM( ceinm )

SUM( cspem ) SUM( cretm ) SUM( cvmla ) SUM( cvmum )

SUM( cvmin ) SUM( cvmei ) SUM( cvmsp ) SUM( cvmre )

FROM mchb

INTO (x_clabs, x_cumlm, x_cinsm, x_ceinm, x_cspem, x_cretm,

x_cvmla, x_cvmum, x_cvmin, x_cvmei, x_cvmsp, x_cvmre)

WHERE matnr = it_batch-matnr

AND werks = it_batch-werks

AND charg = it_batch-charg.

IF NOT ( x_clabs EQ 0 AND

x_cumlm EQ 0 AND

x_cinsm EQ 0 AND

x_ceinm EQ 0 AND

x_cspem EQ 0 AND

x_cretm EQ 0 AND

x_cvmla EQ 0 AND

x_cvmum EQ 0 AND

x_cvmin EQ 0 AND

x_cvmei EQ 0 AND

x_cvmsp EQ 0 AND

x_cvmre EQ 0 ).

DELETE it_batch INDEX x_tabix.

*Begin of Modifications BDVK945500 by TCS941764 on 30/08/2006


CLEAR x_objek.

x_objek(18) = it_batch-matnr.

x_objek+18(4) = it_batch-werks.

x_objek+22(10) = it_batch-charg.

CLEAR inob.

SELECT SINGLE cuobj FROM inob INTO inob-cuobj

WHERE obtab = 'MCHA'

AND objek = x_objek

AND klart = '022'.

CONCATENATE inob-cuobj 'O' INTO it_batch-objectid.

MODIFY it_batch.

*End of Modifications BDVK945500 by TCS941764 on 30/08/2006



How to change the above code for better performance without effecting the results(i mean using for all entries and at end of is it possible?) .Please help me.

Thanks for all.