I have a transshipment problem case where in the demand nodes (end terminal) may also transfer to other demand nodes. I have modeled the balance constraint as follows:

Currently, the problem is that the third element of the left-hand side is the inflow to the demand node from other nodes (note that l and o are both demand node indices, just modeled separately to model the movement of goods from demand to demand node). The problem lies here as I need to sum over l given that the constraint must apply for all values of l.
The first element of the right-hand side is the outflow from the demand node (l) going to other demand nodes (p). Here, there is no error as the sum applies for p.