Skip to Content

Custom Table Transaction ID Not Counting above 100

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.

tbl.PNG (13.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 22, 2016 at 07:23 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 22, 2016 at 07:17 AM

    I think you should check how you declared rv_transid

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.