There are two fields involved here, to store Line Item Number, BSEG-BUZEI(NUMC_3) and FAGLFLEXA-DOCLN(CHAR_6).
Document Line Items from Entry view are stored in BSEG in which BUZEI is only 3 character hence it is limited to 999 lines.
Where as, in Ledger view, Line Items are stored in FAGLFLEXA in which DOCLN is 6 character hence it can accommodate more than 999 lines which could result due document split.
Hope that clarifies.