Hi,
Can we change the logic in the below way:
Pick-up the line items of LIPS-LFIMG is not equal to Zero, from there you can get the CHARG or ANZSN of the line item.
I may be wrong but you can try this with ABAPer.
All the best !!
Regards, Sai Krishna.