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: 

Data in CDHDR

Former Member

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

4 REPLIES 4

Pawan_Kesari
Active Contributor
0 Kudos

If that is tha case then i thnk sorting on CDHDR-UDATE and UTIME will be better.

Former Member
0 Kudos

Hi,

try like this..

CDHDR-CHANGENR = CDHDR-UTIME.

utime captures the last changed time..

Regards

Kiran

Former Member
0 Kudos

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

Former Member
0 Kudos

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