In one FI document there wil be MAXIMUM 999 nos of line items .
For each line item in delivery there will be 2 entries, 1 debit and 1 credit entry so if we devide 999 by 2 it comes 499.5 so in one delivery document there will be at the most 499 line items at the most
To increase it you have to take help of ABAPer
Also u can have look at the note 117708 and 77161 for more clarification
I also believe the number of line item adelivery document can have is 999. But I would be interested to know, why it needs to be 9999???? I don't think any of the customer orders more than 999 items in single order. Consult your ABAP consultant for the consequences and the side effects when you increase the number of line items. All the subsequent documents also should support this.. like pick list, TO, invoice....etc.