SAP ABAP - Sample Report Program On Making ALV Grid Fields Editable.

This is a sample report program which shows how to make alv grid fields editable.
This report program make the total screen editable. Also shown is how an event is triggered at run time.

SAMPLE PROGRAM:

REPORT zsample_alv_grid_edit.

TYPE-POOLS: slis.

* DATE TO BE DISPLAYED
DATA: gt_sflight TYPE TABLE OF sflight.
DATA: gs_layout TYPE slis_layout_alv.

* SELECTION
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.

* ALV EDITABLE SET-UP
gs_layout-edit = 'X'.

* CALL ALV DISPLAY
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZBCALV_FULLSCREEN_GRID_EDIT'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SFLIGHT'
is_layout = gs_layout
TABLES
t_outtab = gt_sflight.

*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->R_UCOMM text
* -->RS_SELFIELD text
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.

IF r_ucomm = '&DATA_SAVE'.

MESSAGE 'Data Is Saved.' TYPE 'E'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_structure_name = 'SFLIGHT'
TABLES
t_outtab = gt_sflight.
ENDIF.
ENDFORM. "user_command


OUTPUT SCREEN:






MORE PROGRAMS ON ALV DISPLAY:


- Dynamic ALV Grid/List Display.


- ALV Tree Display.


- Colors In ALV Grid Display.


- Display Average Value In ALV Report.


- ...Back To Sample Programs, Tips & Tricks On ALV Grid/List Display.

Your suggestions and comments are welcome in this section.


Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.

No comments:

Post a Comment