08-22-2016 8:12 AM
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.
08-22-2016 8: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
08-22-2016 8:17 AM
08-22-2016 10:05 AM
Hello Simone,
rv_transid and trnid (Field) are of same type. Both are of NUMC.
08-22-2016 8: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
08-22-2016 10:09 AM
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
08-22-2016 10:22 AM
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
08-22-2016 10:25 AM
08-22-2016 10:53 AM
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!!!
08-22-2016 12:09 PM
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 !
08-22-2016 2:15 PM
Usually people forget to call the CONVERSION_EXIT_ALPHA_INPUT, adding the CONVERSION_EXIT_ALPHA_OUTPUT is much rarer