Hi,
Ideally it should have worked. Please check the prerequisite for the control break statement:
1. Is should not be used with where clause
2. Should be used in loops
3. Table should be sorted
Still if it does not work, you may need to add the logic to check MATNR of the current line item with previous line item after sorting.
Regards,
VS