Skip to Content
0
Former Member
Oct 08, 2009 at 10:25 AM

In Internal Table logic not matching

13 Views

Hi all

There are 11 machines and for each machine there are 3 shifts . i want to get sum of 3 shifts and write it into another internal table . with the code i have written in debugging mode .if i clear the data i am not getting the sum . if i dont clear it it is adding to next machine number .

LOOP AT ITAB  .
  IF ( ITAB-EQUNR EQ 'ACM-P-01' ) OR ( ITAB-EQUNR EQ 'ACM-P-02' ) OR
     ( ITAB-EQUNR EQ 'ACM-P-03' ) OR ( ITAB-EQUNR EQ 'ACM-P-04' ) OR
     ( ITAB-EQUNR EQ 'ACM-P-05' ) OR ( ITAB-EQUNR EQ 'ACM-P-06' ) OR
     ( ITAB-EQUNR EQ 'ACM-P-07' ) OR ( ITAB-EQUNR EQ 'ACM-P-08' ) OR
     ( ITAB-EQUNR EQ 'ACMA01' ) OR ( ITAB-EQUNR EQ 'ACMA02' ) OR ( ITAB-EQUNR EQ 'ACMA03') .

      CASE ITAB-SHIFT .
       when  'A'.
        MOVE ITAB-PRO TO  ACM1A.
       when  'B'.
        MOVE ITAB-PRO TO  ACM1B.
       WHEN  'C'.
        MOVE ITAB-PRO TO  ACM1C.
      ENDCASE.
  ENDIF.
  ITAB-PRO1 = ACM1A + ACM1B + ACM1C.
APPEND ITAB2.

ENDLOOP.

Sravya