Skip to content
Call: +91-8779272083
Email: info@sapify.in
Enquiry Now
SAPifySAPify
  • Home
  • About Us
  • Courses
  • Blogs
  • Contact Us
  • My Account
0
No products in the cart.
SAPifySAPify
  • Home
  • About Us
  • Courses
  • Blogs
  • Contact Us
  • My Account
  • Home
  • ALV
  • Editable ALV using the procedural approach
ALV

Editable ALV using the procedural approach

  • 29 Jan, 2026
  • Com 0

To create an editable ALV using the procedural approach, we use the REUSE_ALV_GRID_DISPLAY function module. However, to make cells editable, we must use a Field Catalog.

In a field catalog, you define the properties of each column. By setting the EDIT field to ‘X’, the cell becomes an input field.

The ABAP Code

REPORT z_editable_alv_procedural.

* 1. Data Declaration

TABLES: sflight.

DATA: it_sflight TYPE TABLE OF sflight,

      it_fieldcat TYPE slis_t_fieldcat_alv, ” Internal table for field catalog

      wa_fieldcat TYPE slis_fieldcat_alv.    ” Work area for field catalog

* 2. Data Retrieval

START-OF-SELECTION.

  SELECT * FROM sflight INTO TABLE it_sflight UP TO 20 ROWS.

* 3. Building the Field Catalog manually to enable editing

  ” Define Column: Flight Connection ID

  CLEAR wa_fieldcat.

  wa_fieldcat-fieldname = ‘CONNID’.

  wa_fieldcat-seltext_m = ‘Connection ID’.

  wa_fieldcat-tabname   = ‘IT_SFLIGHT’.

  APPEND wa_fieldcat TO it_fieldcat.

  ” Define Column: Price (Make this EDITABLE)

  CLEAR wa_fieldcat.

  wa_fieldcat-fieldname = ‘PRICE’.

  wa_fieldcat-seltext_m = ‘Flight Price’.

  wa_fieldcat-tabname   = ‘IT_SFLIGHT’.

  wa_fieldcat-edit      = ‘X’. ” This makes the column editable

  APPEND wa_fieldcat TO it_fieldcat.

* 4. Display ALV Report

  CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’

    EXPORTING

      it_fieldcat   = it_fieldcat

    TABLES

      t_outtab      = it_sflight

    EXCEPTIONS

      program_error = 1

      OTHERS        = 2.

How the Editability Works

  • The Field Catalog (slis_t_fieldcat_alv): Unlike the previous example where we passed i_structure_name, here we manually define the columns. This is necessary because the standard structure is “read-only” by default.
  • The EDIT Flag: By setting wa_fieldcat-edit = ‘X’, the ABAP runtime renders that specific column as an input field (usually with a white background instead of grey).
  • Data Synchronization: When the user types a new value in the grid and presses “Enter” or “Save,” the values are updated in the internal table it_sflight in the program’s memory.

Important Note on Saving

  • The code above makes the screen editable, but it does not save changes to the database. To save data, you would need to:
  • Add a custom button to the ALV toolbar (using a PF-STATUS).
  • Capture the user action in a USER_COMMAND subroutine.
  • Execute an UPDATE sflight … statement using the modified data in it_sflight.
Share on:
The OO ABAP Editable ALV Code
Simple Editable ALV with Save Logic.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Latest Post

Thumb
The OOPS ABAP ALV Code
29 Jan, 2026
Thumb
Simple Editable ALV with Save Logic.
29 Jan, 2026
Thumb
Editable ALV using the procedural approach
29 Jan, 2026

Categories

  • ABAP (3)
  • ALV (3)
sapify (2)

We are a dedicated SAP technical training platform committed to building industry-

Add: Mumbai, Maharashtra, India.
Call: +91-8779272083
Email: info@sapify.in

Online Platform

  • About
  • Course
  • Instructor

Links

  • Contact Us

Contacts

Enter your email address to register to our newsletter subscription

Icon-facebook Icon-instagram Icon-youtube Icon-linkedin2
Copyright 2026 SAPify | All Rights Reserved
SAPifySAPify