You check assignment of sd condition to co-pa value fields using t-code KE4I.
If SD condition for discount and material cost have same co-pa value filed, your problem is occurred.
To solve your problem, you separate co-pa value filed for discount and material cost.