Hi ,
Actually i've tried a case stmt to delete movement type from the internal table
its works well for lineitem 10 and 20 ...but when it loops for lineitem 30 with movementtype BWART(122 ,101 ,123 )
in case stmt its not considering "WHEN 122" atall (the reason is there is 2 times 122 type for lineitem30 as highlighted below ) .
Finally it shud delete lineitem30 w.r.t mat.doc(5000000043 and 5000000044 ) .
So how to solve this issue ,kindly do the needful as it is urgent .
Code :
LOOP AT GT_EKBE1 INTO GS_EKBE1 WHERE SHKZG = 'H'.
CHECK GS_EKBE1-BWART = '102' or GS_EKBE1-BWART = '122' or GS_EKBE1-BWART = '161' .
CASE GS_EKBE1-BWART.
WHEN ' 122'.
lv_bwart = '123' .
WHEN '102' .
lv_bwart = '101' .
WHEN '161'.
lv_bwart = '162' .
ENDCASE.
READ TABLE GT_EKBE1 INTO GS_EKBE3 WITH KEY EBELN = GS_EKBE1-EBELN
EBELP = GS_EKBE1-EBELP
LFBNR = GS_EKBE1-LFBNR
MENGE = GS_EKBE1-MENGE
BWART = LV_BWART
SHKZG = 'S' .
IF GS_EKBE3 IS NOT INITIAL.
DELETE TABLE GT_EKBE1 from GS_EKBE1.
DELETE TABLE GT_EKBE1 from GS_EKBE3.
ENDIF .
CLEAR : GS_EKBE1 , GS_EKBE3 , LV_BWART .
ENDLOOP .
Regards ,
Wilson .