Hi Purnand,
I have a question for you, the field XABLN is at the header level but you are checking the value at item level (LIPS-KDMAT) so are you sure that the business will maintain same value at all the items of a delivery. If yes then your logic is fine else you need to reconsider.
Regards,
Ankit.