Hi Anushka,
just a simple approach apart from above discussion, add your qty field if po no, mat no and size are same, put it in another variable, use that variable to show in output, then after that use delete adjacent duplicates comparing po no, mat no and size, you will get output as you wants.