Service level is the probability that you can meet the demand or that the demand don't exceed your inventory. You know the demand and what you have as inventory. You know if you can meet the demand or not. Service level doesn't have any meaning in deterministic demand. And, you are trying to find optimal quantity for each period. Unless there is other factor such as fixed setup cost, optimal quantity is the demand.
I agree what you said. But, i am looking for the rationing problem. even though i know the demand i can't meet the whole demand because my capacity is limited. In that case how can we measure service level?
If you consider multi periods, you can do both. Service level can be measured by how many periods you can meet the demand divided by total number of periods. And fill rate can be obtained by dividing total sales by total demands, over multi period.