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 SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




Install SAP Free


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.

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 Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Related Articles and Tutorials(http://www.kodyaz.com/articles/sap-abap-alv-grid-sample-reuse-alv-grid-display.aspx)
Trigger ALV Events in Web Dynpro Component
SAP Web Dynpro ALV Tutorial with Sample
SAP ABAP Tutorial - ALV Grid Example with cl_gui_alv_grid and Screen Painter
ALV Grid Color - Table Row Background Color in ALV List
Add Button to ALV Table Header on SAP Web Dynpro
Traffic Lights in SAP Web Dynpro ALV Table
Multi Color ALV Grid Color Alternate using ALV Layout info_fname Property
SAP - ABAP ALV Grid Sample Code using REUSE_ALV_GRID_DISPLAY
Remove ALV Buttons on SAP Web Dynpro Component
Create CL_GUI_ALV_GRID ALV Grid Column Header using ABAP Data Element
Enable SAP Users Create Own Layout Variants using set_table_for_first_display
Read Checkbox Value in Web Dynpro Editable ALV
Component Usage ALV Does Not Have an Active Component
SAP - ABAP ALV Grid Sample Code using REUSE_ALV_GRID_DISPLAY


Copyright © 2004 - 2018 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems