Tuesday, December 21, 2010
The wrapper class implemented to encapsulate ALV Grid functionality is “CL_GUI_ALV_GRID”.As a control object, ALV Grid instance requires a container to be linked to the screen. Generally, an instance of the class “cl_gui_custom_container” is used for this purpose.
- Create one program and paste the below code.
REPORT ZTEST_NOTEPAD. DATA: G_GRID_CONTROL TYPE REF TO CL_GUI_ALV_GRID, G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER. DATA: IT_T100 TYPE TABLE OF T100. *start-of-selection START-OF-SELECTION. CALL SCREEN 1001. *&---------------------------------------------------------------------* *& Module INITIALIZE_DATA OUTPUT *&---------------------------------------------------------------------* MODULE INITIALIZE_DATA OUTPUT. IF G_CUSTOM_CONTAINER IS INITIAL. CREATE OBJECT G_CUSTOM_CONTAINER EXPORTING CONTAINER_NAME = 'C_CUSTOM_CONTROL'. CREATE OBJECT G_GRID_CONTROL EXPORTING I_PARENT = G_CUSTOM_CONTAINER. ENDIF. IF IT_T100[] IS INITIAL. SELECT * FROM T100 INTO TABLE IT_T100 UP TO 20 ROWS WHERE SPRSL = SY-LANGU. ENDIF. CALL METHOD G_GRID_CONTROL->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME = 'T100' CHANGING IT_OUTTAB = IT_T100. ENDMODULE. " INITIALIZE_DATA OUTPUT
- Double click on 1001 screen and description.
- Go to Layout of the screen and drag and drop custom control and give name ' C_CUSTOM_CONTROL'.
- Flow logic of the screen.
PROCESS BEFORE OUTPUT. MODULE INITIALIZE_DATA. PROCESS AFTER INPUT. * MODULE USER_COMMAND_1001.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.