21/05/2013

Display List of Company Code

*&---------------------------------------------------------------------*
*& Module Pool       Z_ALV_MOD_COMAPNY_CODE
*&
*&---------------------------------------------------------------------*
*&
*&Author                        tech.sap29@gmail.com
*&---------------------------------------------------------------------*

PROGRAM  Z_ALV_MOD_COMAPNY_CODE.

DATA : O_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER ,
       O_GRID      TYPE REF TO CL_GUI_ALV_GRID,
       IT_T001     TYPE TABLE OF T001.






*&---------------------------------------------------------------------*
*&      Module  STATUS_9001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_9001 OUTPUT.
  SET PF-STATUS 'ZSTATUS'.
*  SET TITLEBAR 'xxx'.

CREATE OBJECT O_CONTAINER
  EXPORTING
*    PARENT                      =
    CONTAINER_NAME               = 'CON1'

        .
IF SY-SUBRC = 0.
CREATE OBJECT O_GRID
  EXPORTING
*    I_SHELLSTYLE      = 0
*    I_LIFETIME        =
    I_PARENT          = O_CONTAINER .
IF SY-SUBRC = 0.

CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
*    I_BUFFER_ACTIVE               =
*    I_BYPASSING_BUFFER            =
*    I_CONSISTENCY_CHECK           =
    I_STRUCTURE_NAME              = 'T001'
*    IS_VARIANT                    =
*    I_SAVE                        =
*    I_DEFAULT                     = 'X'
*    IS_LAYOUT                     =
*    IS_PRINT                      =
*    IT_SPECIAL_GROUPS             =
*    IT_TOOLBAR_EXCLUDING          =
*    IT_HYPERLINK                  =
*    IT_ALV_GRAPHICS               =
*    IT_EXCEPT_QINFO               =
*    IR_SALV_ADAPTER               =
  CHANGING
    IT_OUTTAB                     = IT_T001
*    IT_FIELDCATALOG               =
*    IT_SORT                       =
*    IT_FILTER                     =
*  EXCEPTIONS
*    INVALID_PARAMETER_COMBINATION = 1
*    PROGRAM_ERROR                 = 2
*    TOO_MANY_LINES                = 3
*    others                        = 4
        .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDIF.
ENDIF.
ENDMODULE.                 " STATUS_9001  OUTPUT



*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_9001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9001 INPUT.
CASE SY-UCOMM.
  WHEN 'BACK'.
    LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_9001  INPUT


*&---------------------------------------------------------------------*
*&      Module  FETCH_DATA  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE FETCH_DATA OUTPUT.
SELECT * FROM T001 INTO TABLE IT_T001 UP TO 20 ROWS .
ENDMODULE.                 " FETCH_DATA  OUTPUT

No comments:

Post a Comment