02-27-2009 4:53 PM
HI,
We have a logic where data is selected from table CDHDR and this selected data is sorted in descending order on the basis of field CHANGENR and then we select the first record.
The aim here is to select the latest change record with the assumption that the latest change will be assigned the highest CHANGENR.
But we are encountering situations where the latest / highest change number is not being assigned to the latest change.
For example a user with userid ABC makes a change in a purchase order at 10:51 and is assigned a change no. 123. and then another user with userid XYZ makes a change in the same purchase order at 10:53 but has been assigned the change no. 122.
Please advice how a lowere change number is being assigned to the latest change.
Although I would like to mention this situation happens rarely but when it occurs, it does cause a lot of issues.
I hope I am clear.
Please advice.
Thanks and regards
Abhishek
02-27-2009 5:14 PM
If that is tha case then i thnk sorting on CDHDR-UDATE and UTIME will be better.
02-28-2009 2:25 AM
Hi,
try like this..
CDHDR-CHANGENR = CDHDR-UTIME.
utime captures the last changed time..
Regards
Kiran
02-28-2009 7:47 AM
The aim here is to select the latest change record with the assumption that the latest change will be assigned the highest CHANGENR.
why are u sorting on basis of changenr, always sort on basis of udate and utime and then get the changenr of the latest record on basis of udate and utime.
since have date and time of change no need to assume with changenr
Edited by: kartik tarla on Feb 28, 2009 1:18 PM
03-02-2009 3:27 PM
HI All,
Thanks for all your response.
Before I sort on the UDATE and UTIME, could you please tell me how exactly is this change number assigned ?
I mean I am just a bit confused like how did the latest change did not get the latest change number, just wanted to know if this is a bug or something else.
Thank you
Abhishek