Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Table Transaction ID Not Counting above 100

Austin_D_Costa
Explorer
0 Kudos

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.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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

9 REPLIES 9

SimoneMilesi
Active Contributor
0 Kudos

I think you should check how you declared rv_transid

0 Kudos

Hello Simone,


rv_transid and trnid (Field) are of same type. Both are of NUMC.

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Hi Raymond,

Here RV_TRANSID and the field TRNID are of NUMC.

And i Didn't use any number range function modules here.

I have just created a domain of data typr NUMC and of Characrters 10.

Yes!!! even i have tried with conversion_exit_output while saving the data to table. But sometimes the for the existing records, table display message "no records found".

Please find attachment

0 Kudos

so RV_TRANSID is declared like this?


DATA: RV_TRANSID(10) type N.


because to me it seems from your initial post that you declared RV_TRANSID too small to manage correctly numbers > 99


0 Kudos

No... its been declared through parameter!!!

0 Kudos

Hello Raymond,

I used  CONVERSION_EXIT_ALPHA_OUTPUT while saving record. But actually i should save without the conversion. i.e 0000000100 (not 100).

There was the issue. So it was considering  0000000101<100. (While sorting).

Thanks a lot for Help!!!

0 Kudos

You should interpret the question of Simone. In your particular case, just translate it as follows: "is ZFI_VEN_ADV-TRNID defined like type NUMC of length 10 ?"

Anyway, your types seem to be incoherent, they all should be N (ABAP) or NUMC (DDIC), this way you wouldn't need to do the conversion explicitly !

0 Kudos

Usually people forget to call the CONVERSION_EXIT_ALPHA_INPUT, adding the CONVERSION_EXIT_ALPHA_OUTPUT  is much rarer