Im not sure that this is even an ABAP problem anymore but its unlikely not to have been an issue for others.
The user creates a requirement via CO01. The corresponding item and its BOM appear in RESB. Typically a BOM can have over 3000 components.
A change is made to the BOM and SAP rebuilds it. So far, so good. Here's the rub : The new BOM is created under the reservation number in RESB but the POSNR sequence starts where the copied BOM left off. So if the earlier BOM ended with POSNR = 3122, the replacement will start with 3123.
The issue is that POSNR is not big enough. Too many changes and the program dumps.
There are plenty of views for RESB and many FMs available to change RESB. BUT, becasue the reservation is created automaticlly, MB22 cant touch it and neither can any FMs.
I dont think ABAP is going to solve this anyway. Any suggestions?