For different IDoc, the limit on maximum number of segment is set in different codes.
For IS-Retail POS outbound, the limit is set in LWPDATOP:
c_max_idoc TYPE i VALUE 5000,
For POS DM, the limit is set in outbound task settings in /POSDW/IMG.