首页 > SAP > ABAP > How to modify default field catalog of ABAP ALV with IDA on HANA
2019
08-29

How to modify default field catalog of ABAP 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 this tutorial we will learn how to modify default field catalog of ABAP ALV with IDA on HANA.

To modify  the field catalog of ALV with IDA

Get the reference object for the field catalog by calling the method FIELD_CATALOG( ) in interface IF_SALV_GUI_TABLE_IDA.

Use the method GET_ALL_FIELDS( ) to get columns of ALV.Modify the field catalog as per your requirement.
Use the method SET_AVAILABLE_FIELDS( ) to set back the field catalog of ALV

Lets see how we can do it

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

How to modify default field catalog of 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 modify default field catalog of ABAP ALV with IDA on HANA - 第2张  | 优通SAP

3. Copy and paste the below code.

4. Lets look at what have we written,

Create a reference object of ALV by passing the table name SNWD_PD.
Get the field catalog reference object by calling the method FIELD_CATALOG( ).
Get all the columns of ALV by calling the method GET_ALL_FIELDS( ).
By default all columns available in the table/view will be available in the ALV field catalog. So either remove the columns which are not required (or) clear the default field catalog and add the columns which are required.
Finally set the field catalog back to the ALV by calling the method SET_AVAILABLE_FIELDS( ).

5. Activate and execute the ABAP program/report.

[adsenseyu1][adsenseyu1]

6. Below is the output before removing the column Category.

How to modify default field catalog of ABAP ALV with IDA on HANA - 第3张  | 优通SAP

7. Below is the output after removing the column category.

How to modify default field catalog of ABAP ALV with IDA on HANA - 第4张  | 优通SAP

You have successfully modified the default catalog of an ABAP ALV with IDA. 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