首页 > SAP > ABAP > How to set SELECT-OPTIONS to the ALV with IDA on HANA
2019
08-29

How to set SELECT-OPTIONS to the ALV with IDA on HANA

Hello everyone, In our previous tutorial we introduced you to the new flavor of ABAP ALV called ALV with Integrated Data Access(IDA). In our previous tutorial we have retrieved the full data, but usually users want to restrict the data retrieved by using select options.In this tutorial, we will learn how to set SELECT-OPTIONS to the ALV with IDA. So lets get started.

To set the select options to the ALV with IDA

Create a range table for select-options on the selection screen using the method ADD_RANGES_FOR_NAME of class CL_SALV_RANGE_TAB_COLLECTOR.
Use the method GET_COLLECTED_RAGES method of class CL_SALV_RANGE_TAB_COLLECTOR to get the ranges.
Pass the above created ranges to the method SET_SELECT_OPTIONS of IDA class CL_SALV_GUI_TABLE_IDA.

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

How to set SELECT-OPTIONS to the 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 SELECT-OPTIONS to the ALV with IDA on HANA - 第2张  | 优通SAP

3. Copy and paste the below code.

4. Lets look at what have we written,

Declared the select options for the field PRODUCT_ID.
Create and add the range table for the select options PRODUCT_ID.
Get the ranges of select options into the table LT_SELECT_OPTIONS.
Finally set the select options to the ALV with IDA using SET_SELECT_OPTIONS.

5. Activate and execute the ABAP program/report.

[adsenseyu1][adsenseyu1]

6. Provide values for select options of product id and hit execute button.

How to set SELECT-OPTIONS to the ALV with IDA on HANA - 第3张  | 优通SAP

7. You should see the output for the selected product ids only like below.

How to set SELECT-OPTIONS to the ALV with IDA on HANA - 第4张  | 优通SAP

8. You can add as many as select options you want.

You have successfully created an ABAP ALV with IDA using Select Options. Please stay tuned to us for ABAP on HANA and ABAP in Eclipse tutorials.Please feel free to comment and let us know your feedback. You feedback will keep us alive.

Thank you.

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