Hello Experts,
I have created a custom table, with the field TRNID with data type NUMC and Length 10.
Now,
1. The problem i'm facing is i have used a query, Which increments the number by 1.
SELECT MAX( trnid ) FROM ztbl1
INTO rv_transid.
ADD 1 TO rv_transid.
But once the number reaches 99, always the query takes maximum as 99, and generates 99+1=100 in all the scenarios. For the next time it never considers 100 as maximum to generate 101.
2. In the tablei have checked the transaction ID where i have sorted the field, eventhough the it shows 99 as maximum.
I have attached the screenshot of the table. Please have a glance.
Try to browse the table without conversion exit, here sort indicates 100 < 99, so I suppose ' 100' < '0000099' (where are records 1-9). How did you declare rv_transid. Some CHAR type, so an 'undesired' implicit conversion exit during incrementation?
What will happen when concurrent users try to update the table, do you manage some exclusive lock, or could you consider using a range number (transaction SNRO, FM NUMBER_GET_NEXT)
Regards,
Raymond
I think you should check how you declared rv_transid
Add a comment