The billing document can have upto 999 line items per standard and not sure why want to restrict to 99 lines. Can you check OSS 1483198 - Error F5 727 "Maximum number of items in FI reached" when releasing invoice to accounting. of any help to your requirement?
Regards,