2013 Feb 27 5:47 PM
Hi Experts,
We get a frequent dump on the below select in Production system for dupliacte key
select data from bsis into itab where bukrs on selection screen
gjhar on selection screen
->dump on this select
select data from bsas appending table itab where bukrs on selection screen
gjhar on selection screen
My ITAB is sorted table WITH UNIQUE KEY bukrs gjahr belnr buzei
I cannot replicate the same error in production and i have checked the database table and i am quite sure that BSIS and BSAS cannot have duplicate
records for the key bukrs gjahr belnr buzei
I can make the itab non unqiue key and it will not cause this issue but i wanted to know if this scenario can happen?
Thanks
2013 Feb 27 6:14 PM
2013 Feb 27 6:14 PM
2013 Feb 28 12:35 PM
You could also try an execution of report RFINDEX in quality assurance and/or development systems to execute "FI Consistency check", check the first two boxes "Documents vs Indexes" and "Indexes vs Documents". Alas only SAP is allowed to use the correction tool included (and locked/hidden) in this tool.
But if your are enough self confident, you should be able to find it in debug mode , but don't do this in production of course, if errors are reported in production create an OSS message with component FI-GL-GL-X.
Regards,
Raymond
2013 Feb 27 6:22 PM
Dear Bhanu,
The concept is you cannot append the internal table which is declared as sorted you should always Insert the internal table
So when you write select with appending it gives dump.
A table index administrates the logical order of table rows. As the primary table index of a standard table for managing the order arising from index operations. However, the order in the index has no relation to the content of the table rows But primary table index of a sorted table for managing the order of table rows in accordance with the sorted primary or secondary table key. So when you append it appends as last entry not in order so it gives dump.
Hope it helps you.
Kindly let me know.
Thanks & Regards,
Vignesh Yeram
2013 Feb 27 7:56 PM
Hi Vignesh,
Not able to understand what you are saying may be a example could be great.
Do you have any SAP help document which sayes we cannot use "Appending" operation with
sorted tables.
2013 Feb 28 11:18 AM
Dear Bhanu,
Usually this concept of not using appending for sorted tables are better known to CRM technical people. right now i dont have anydocument but technically the tables which has algorithm you cannot disturb that for example when you append you are appending the records one after the another so sorting is disturbed it's algorithm is disturbed so it gives dump. When you insert a sorted table it is implicitly inserted into sorted internal table in sorted way.Also if you try to append duplicate entries it will give runtime error. Also a runtime error occurs if you disturb the sort order of a sorted table by appending to it.
On your request just now i found a link http://scn.sap.com/thread/1171093
Hope it helps you
Kindly let me know.
Thanks & Regards,
Vignesh Yeram
2013 Feb 28 11:53 AM
Hi Bhanu and Vignesh,
In fact if you try to append rows against sorted columns sequence. Inserting lower value than last maximum in ascending sorted table results in error. This is because append tries to add rows at the end of table. However:
Regards
Adam
2013 Feb 28 12:17 PM
Just for information there is no problem to SELECT APPENDING TABLE if the target table is sorted.
The result set is inserted into the internal table itab line-by-line; a sorting process is executed in the case of a sorted table. If INTO is used, the internal table is initialized. Previous lines remain intact if APPENDING is used.
(http://help.sap.com/abapdocu_731/en/abapinto_clause.htm)
So, the error should come from actual duplicates.
Regards,
Raymond
2013 Feb 27 7:29 PM
Hello Bhanu,
This run time error may occur if change operations are performed in the selected table at the time when the SELECT statements are executed. So If you want to use your ITAB as sorted one then you have to use enqueue locks to avoid simultaneous change operations.
OR
Use your ITAB with non unique key and use "DELETE ADJACENT DUPLICATES" considering your business logic. But keep in mind you should be very careful here.
Regards,
Sudhir Kothavale.
2013 Feb 28 8:46 AM
Hi Bhanu,
I think that error is anyhow caused by logic and duplicated data.
If you cannot reproduce situation you can do:
Hope it helps.
Regards,
Adam
2013 Feb 28 3:24 PM
Sudhir: Its a report program no enqueues....totally worng.
Vignesh:We can use Appending with sorted tables.
Thanks Guys for your help. For now i will try to replicate the scenario or will try to catpturre the exception.
Thanks
Bhanu
2013 Feb 28 4:41 PM
Hello Bhanu,
I am talking about the tables from where you are fetching the data. For more details refer SAP note 1080997.
Regards,
Sudhir Kothavale.