Saturday, December 18, 2010
Class CL_GUI_DOCKING_CONTAINER is used to display ALV in docking container

REPORT  ZALV_OOPS_WO_CONTROLLER.
"Docking Container declarations
DATA:
G_DOCKING_CONTAINER_1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
G_GRID                TYPE REF TO CL_GUI_ALV_GRID.

"Variables Declarations
DATA:
ITAB   LIKE SFLIGHT OCCURS 0 WITH HEADER LINE,
OKCODE LIKE SY-UCOMM.

SELECT * FROM SFLIGHT INTO TABLE ITAB.

SET SCREEN 101.

*----------------------------------------------------------------------*
*  MODULE STATUS_0101 OUTPUT
*----------------------------------------------------------------------*

MODULE STATUS_0101 OUTPUT.
  SET PF-STATUS 'MENU'.
  SET TITLEBAR 'TIT'.
  PERFORM CREATE_AND_INIT_CONTROLS.
ENDMODULE.                 " STATUS_0101  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  create_and_init_controls
*&---------------------------------------------------------------------*
FORM CREATE_AND_INIT_CONTROLS .
  CREATE OBJECT G_DOCKING_CONTAINER_1
    EXPORTING
      REPID     = SY-REPID
      DYNNR     = '101'
      SIDE      = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_TOP
      EXTENSION = 100.

  CREATE OBJECT G_GRID
    EXPORTING
      I_PARENT = G_DOCKING_CONTAINER_1.

  CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
      I_STRUCTURE_NAME = 'SFLIGHT'
    CHANGING
      IT_OUTTAB        = ITAB[].
ENDFORM.                    " create_and_init_controls
*----------------------------------------------------------------------*
*  MODULE user_command_0101 INPUT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0101 INPUT.
  CASE OKCODE.
    WHEN 'BACK'.
      SET SCREEN 0.
  ENDCASE.
ENDMODULE.                 " user_command_0101  INPUT
Screen Flow Logic
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN SUB_SCR1 INCLUDING 'ZVENKAT_ALV_CONTROL' '101'.
MODULE DISPLAY_ALV.

PROCESS AFTER INPUT.
CALL SUBSCREEN SUB_SCR1.
MODULE USER_COMMAND_0100.

PROCESS BEFORE OUTPUT.
CALL SUBSCREEN SUB_SCR1 INCLUDING 'ZVENKAT_ALV_CONTROL' '101'.
MODULE DISPLAY_ALV.

PROCESS AFTER INPUT.
CALL SUBSCREEN SUB_SCR1.
MODULE USER_COMMAND_0100.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.