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

How to set PARAMETERS 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 Date Access(ALV with IDA). In our previous tutorial we have retrieved the full data, but usually users want to restrict the data retrieved by using “Parameters” on selection screen of the report.In this tutorial, we will learn how to set parameters to the ALV with IDA. So lets get started.

To set the PARAMETERS to ALV with IDA

Get the reference object for the IDA condition factory IF_SALV_IDA_CONDITION_FACTORY  by calling the method CONDITION_FACTORY( ).

Build the conditions by using the method EQUALS( ).
Pass the above created conditions 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 PARAMETERS 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 PARAMETERS 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 and PARAMETERS for CATEGORY.
Create and add the range table for the select options PRODUCT_ID.
Get the ranges of select options into the table LT_SELECT_OPTIONS.
Build the conditions for the  PARAMETERS on selection screen using condition factory classes.
Finally set the select options and parameters to the ALV with IDA using SET_SELECT_OPTIONS.

5. Activate and execute the ABAP program.

[adsenseyu1][adsenseyu1]

6. Provide values for parameter product category selection screen and hit execute button.

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

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

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

8. Now provide both Parameters and select-options on selection screen.Hit execute button

How to set PARAMETERS to the ALV with IDA on HANA - 第5张  | 优通SAP

How to set PARAMETERS to the ALV with IDA on HANA - 第6张  | 优通SAPYou have successfully created an ABAP ALV with IDA using Parameters and 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
这个作者貌似有点懒,什么都没有留下。