2013 Jun 27 8:14 AM
Hello All ,
I have an ALV program which updates a ZTABLE.
The issue which I am facing is that the order of records and in that table is getting just reversed.
I am using record by record update using MODIFY statement.
Eg.
After Save ,
Display when report re run ,
In SE11
also records are in above order.
Valuable suggestions required ABAP Gurus.
2013 Jun 27 8:29 AM
Hi Sij,
In Database table the records stored in sorted manner based on primary key.
regards,
Anil.
2013 Jun 27 8:21 AM
Hi Sijin,
It doesnot matter on what sequence you will enter the data the data will be displayed in assending order.
Regards,
Niladri
2013 Jun 27 8:25 AM
Hi,
Is Material Code primary key? If so remove the primary key and check if it following the order you saved?
Regards,
Swarna
2013 Jun 27 8:28 AM
Hello Swarna ,
Thanks for your prompt reply ,
Yeah Material code is a part of Primary key and I can't change it . I want unique record material wise only.
Primary key used is a composite key ( with combination of 3 other fields along with MATNR )
2013 Jun 27 8:29 AM
Hi Sij,
In Database table the records stored in sorted manner based on primary key.
regards,
Anil.
2013 Jun 27 9:51 AM
Okay fine Anil ,
Then can you provide any hint how to get things done as required
2013 Jun 27 10:01 AM
Hello Anil ,
So the records might be sorted in Ascending order in Database table.
So am going to add one extra field counter in my DB table which will increment with each update operation , let me check with this solution.
2013 Jun 27 10:39 AM
2013 Jun 27 3:58 PM
But did you create an unique index MANDT/MATNR for your other requirement
Yeah Material code is a part of Primary key and I can't change it . I want unique record material wise only.
Regards,
Raymon
2013 Jun 28 5:35 AM
Hello ,
I have added Counter field between the already existing Keys , as shown below.
So it will work perfectly fine.
Very thanks for showing your concern
2013 Jun 27 8:31 AM
It is in the impact of the Table defenition Primary Keys.
In your case, probably you may need to add the time of entry also in your Key field of table.
Then it will show you in the same sequence as exactly as the way you update...
Regards,
Venkat
2013 Jun 27 8:35 AM
Okay ,
I have got a Time of Entry field.
And will try your solution.
And revert
2013 Jun 27 9:55 AM
No its not working ,
cause more than one records are updated in a same session.
2013 Jun 27 9:56 AM
Dear Sij,
Sort the Internal Table by MATNR Before Display.
Thanks & Regards.
Kranthi
2013 Jun 27 10:03 AM
Hi Sijin,
In your table add time and date fields and make them as key fields, and when you are retrieving the records, get the last updated entry this will work for your requirement.
2013 Jun 27 1:32 PM
Hello All ,
I have got it solved .
By adding Counter field.
My concern was not with the ALV output but with the order maintained in DB table underneath.
2014 Mar 13 1:30 PM
Hi,
Can you please Publish the code .I have also same requirement.Please Publish the code pls...
2014 Mar 13 1:59 PM
I have already pasted all the relevant details in this thread.
i.e Structure of table .
You just need to add counter with + 1 with each iteration.
Rest
In Database table the records stored in sorted manner based on primary key.
will take care of.
2014 Mar 13 2:09 PM
Please paste the Thread link where i can get the coding details.Pls...
2014 Mar 13 2:12 PM
Cool ,
I wrote the code myself and I haven't published it anywhere.
Just mention at what place you are facing the problem.
2014 Mar 13 2:17 PM