Getting the product master physical and available quantity depend upon the variance in AX 2012 R2

Hi Friends,
How can I get the price value depend upon the variant?
Exampe: I have one product called “AAA”, I have 2 variance(Color, Size).
In inventory “AAA” product have 10 quantity.
1). AAA - size 10, color Black - 5 quantity
2). AAA - size 12, color White - 5 quantity
Friend, how can I get the quantity value for that variance 1, 2 through X++.