Application Development and Automation 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: 
Read only

Explicit Sorting

Former Member
0 Likes
2,181

Hi Experts,

I know that cluster/pool tables when migrated to HANA database gets converted to transparent table because of which explicit sorting is required in existing ABAP codes like adding order by clause while fetching data from pool/cluster table.

But my question here is...what about the already existing transparent table's behavior after migrating to HANA DB ?

Is it required to sort the data fetched from transparent tables ?

Thanks

Punit

1 ACCEPTED SOLUTION
Read only

pfefferf
Active Contributor
0 Likes
1,424

Hello Punit,

a select statement on HANA returns the data in most cases in a different order than other database systems. The reason is the different data materialization behavior.

So at every position where the order of the selected data is relevant the data has to be sorted explicitly (either by ORDER BY in the select clause or a SORT). For instance if you select a collection of data and in the ABAP program you read the first entry the behavior can be different on HANA compared to another DB system if you do not have sorted the data.

SAP provides the CodeInspector check variant FUNCTIONAL_DB which does several checks regarding the behavior of ABAP programs running with HANA. One check is the "Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY". You can check your programs with that variant to find (nearly almost) positions which need to be adapted.

Best Regards,

Florian

3 REPLIES 3
Read only

pfefferf
Active Contributor
0 Likes
1,425

Hello Punit,

a select statement on HANA returns the data in most cases in a different order than other database systems. The reason is the different data materialization behavior.

So at every position where the order of the selected data is relevant the data has to be sorted explicitly (either by ORDER BY in the select clause or a SORT). For instance if you select a collection of data and in the ABAP program you read the first entry the behavior can be different on HANA compared to another DB system if you do not have sorted the data.

SAP provides the CodeInspector check variant FUNCTIONAL_DB which does several checks regarding the behavior of ABAP programs running with HANA. One check is the "Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY". You can check your programs with that variant to find (nearly almost) positions which need to be adapted.

Best Regards,

Florian

Read only

Former Member
0 Likes
1,424

Hi Florian,

Thanks for your reply!!

But I referred Note 1794490 which states that only pool/cluster tables which are converted to transparent table on HANA requires explicit sorting.

Are you saying that even existing transparent tables requires explicit sorting. If yes then do you have any OSS note or document supporting this?

Thanks

Punit

Read only

pfefferf
Active Contributor
0 Likes
1,424

Please check documentation ABAP Test Cockpit and Code Inspector in Context of HANA Migration - SQL Performance Monitoring - SAP... and the mentioned note 1912445.

Regards,

Florian