Professional Documents
Culture Documents
Working On ALV With Dynamic Internal Tables PDF
Working On ALV With Dynamic Internal Tables PDF
Internal Tables
Applies to:
SAP ECC 6.0 or higher. For more information, visit the ABAP homepage.
Summary
This article demonstrates usage of advanced ALV features like editable ALV at cell level when working with
dynamic internal tables.
Author Bio
Nirav Goradia is a Technical Consultant working with L&T Infotech, Mumbai, India. His SAP
experience of over 4 years spans various technologies like ABAP, Webdynpro for ABAP,
Webdynpro for Java, Adobe Flex.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 1
Working on ALV with Dynamic Internal Tables
Table of Contents
Introduction ......................................................................................................................................................... 3
Create field catalog for ALV ................................................................................................................................ 3
Create field catalog for dynamic internal table ................................................................................................... 3
Populate data in dynamic internal table .............................................................................................................. 4
Display ALV on screen ....................................................................................................................................... 5
Related Content .................................................................................................................................................. 6
Disclaimer and Liability Notice ............................................................................................................................ 7
Introduction
ALV stands for Advanced List Viewer, mainly used to enhance the output of a report. ALV comes with set of
functions that enhance the readability and functionality of ALV report. One important function that we will be
focusing on in this article is creating editable ALV at cell level. Though creating an editable ALV is a straight-
forward process, things can become little tricky if data displayed in ALV is coming from dynamic internal
table and we need to make only certain rows of ALV as editable. We will see in detail, things to take care
when working on ALV with dynamic internal tables.
wa_fieldcat-fieldname = 'FIELD1'.
wa_fieldcat-domname = 'CHAR10'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'FIELD2'.
wa_fieldcat-domname = 'CHAR10'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_field_dom-name = 'FIELD1'.
wa_field_dom-type ?= cl_abap_datadescr=>describe_by_name(
'CHAR10' ).
APPEND wa_field_dom TO it_field_dom.
wa_field_dom-name = 'FIELD2'.
wa_field_dom-type ?= cl_abap_datadescr=>describe_by_name(
'CHAR10' ).
APPEND wa_field_dom TO it_field_dom.
wa_field_dom-name = 'CELLTAB'.
wa_field_dom-type ?= cl_abap_datadescr=>describe_by_name(
'LVC_T_STYL' ).
APPEND wa_field_dom TO it_field_dom.
IF sy-subrc = 0.
<fs_comp> = it_data_table-field1.
ENDIF.
Make sure you have provided the style field name in the layout structure as CELLTAB viz. name of the field
of type 'LVC_T_STYL' that is part of the internal table.
wa_layout-stylefname = 'CELLTAB'.
Since we are working with field symbols here, it is mandatory to put check at all relevant places to make sure
field symbols are assigned to avoid runtime errors. Such case is more likely to occur when there is no data to
be displayed in ALV.
Related Content
Simple ALV list for beginners
ALV Grid Control
ABAP Development and Programming
For more information, visit the ABAP homepage.