Hi Rubab,
Above code logic will definitely work.
Just a second thought, will the field selection (OICMPD) is not sufficient, like making requirement quantity mandatory field mandatory.
Below is how my system displayed when i entered the material in the components tab.
I hope this is your issue right, or i understood differently. ![]()
May be if this requires only at the time of creation, since this field selection can be set at Order type only, not in transaction level.
Regards
Terence