- This code is obviously for PAI and not PBO,
- Don't use sy-ucomm but the ok_code defined in dynpro.
- Don't use the max for counter better define but use a number range (SNRo / NUMBER_GET_NEXT )
Could you reformulate your requirement (without crystal ball I can not see left/right side of your screen...)
Regards,
Raymond