首页 > SAP > ABAP > How to set Sort Order in ABAP ALV with IDA on HANA
2019
08-29

How to set Sort Order in ABAP ALV with IDA on HANA

Hello everyone, In our previous tutorials we introduced you to the new flavor of ABAP ALV called ALV with Integrated Data Access(IDA). In this tutorial you will learn how to set the default sorting to the ALV with IDA on HANA. Lets get started. Below is the method which we can use to display the sorted ALV with IDA on HANA.

[perfectpullquote align=”full” cite=”” link=”” color=”#7ad03a” class=”” size=”18″]SET_SORT_ORDER( ) in interface IF_SALV_GUI_LAYOUT_IDA[/perfectpullquote]

To set the sorting order to ALV with IDA

Get the reference object of Layout by calling the method DEFAULT_LAYOUT( ) in interface IF_SALV_GUI_TABLE_IDA.
Define the sorting rule by adding the column name, sorting order
Set the sorting rule to the ALV to the layout by calling the method SET_SORT_ORDER().

1.Step-by-Step Procedure

Create an ABAP Program in Eclipse.Enter Name, Description and click on Next.

How to set Sort Order in ABAP ALV with IDA on HANA - 第1张  | 优通SAP

2. In the Selection of Transport Request window, choose the transport request. As we are saving the program in $TMP package in our case no transport request is required.Click on Finish.

How to set Sort Order in ABAP ALV with IDA on HANA - 第2张  | 优通SAP

3. Copy and paste the below code.

[adsenseyu1][adsenseyu1]

4. Activate and Execute the ABAP program.

5. Below is the output before applying sorting rule on the column “Category”.

How to set Sort Order in ABAP ALV with IDA on HANA - 第3张  | 优通SAP

6. Below is the output after applying sorting rule on the column “Category”.

How to set Sort Order in ABAP ALV with IDA on HANA - 第4张  | 优通SAP

Congrats! You have successfully learned how to set Sort Order in ABAP ALV with IDA on HANA. Please stay tuned for ALV with IDA for HANA tutorials. Leave a comment in the below comment section and let us know your feedback.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519