SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

SAP - ABAP ALV Grid Sample Code using REUSE_ALV_GRID_DISPLAY


In this sample ABAP program we will work on listing SAP tables contents using ABAP ALV grid using reuse_alv_grid_display function.

The sample ABAP code used to display data in SAP SAPLANE table using ALV grid by function calls to REUSE_ALV_FIELDCATALOG_MERGE and REUSE_ALV_GRID_DISPLAY functions.





REPORT ZTEST_SAPLANE.

DATA:
  gs_saplane TYPE saplane,
  gt_saplane TYPE TABLE OF saplane.

SELECT * FROM saplane INTO TABLE gt_saplane.

TYPE-POOLS slis.

DATA:
  gt_fieldcat TYPE slis_t_fieldcat_alv,
  gv_title TYPE lvc_title.

gv_title = 'SAP Table SAPLANE contents'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
  i_program_name = SY-REPID
  i_structure_name = 'SAPLANE'
CHANGING
  ct_fieldcat = gt_fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  it_fieldcat = gt_fieldcat
  i_grid_title = gv_title
TABLES
  t_outtab = gt_saplane.
Code

The output screen by using ABAP alv grid sample is as shown in the below ABAP program output screen.
You can add columns to the ALV grid or remove columns from the ALV grid by using APPEND ABAP command on the field catalog it_fieldcat parameter value.
We will work with ABAP samples on ALV grid for modifying the it_fieldcat field catalog in further ABAP tutorials examples.

abap alv grid reuse_alv_grid_display



SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.