Chinaunix首页 | 论坛 | 博客
  • 博客访问: 404716
  • 博文数量: 120
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 1266
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-16 16:04
文章分类

全部博文(120)

文章存档

2011年(4)

2010年(10)

2009年(38)

2008年(68)

我的朋友

分类:

2008-10-14 15:52:00

REPORT  Z_DOCKING_ALV.
DATA: L_DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
      L_ALV TYPE REF TO CL_GUI_ALV_GRID ,
      LT_MARA TYPE TABLE OF MARA ,
      INIT(1),
      IT_EXCLUDE TYPE TABLE OF SY-UCOMM.
PARAMETERS:P_COUNT TYPE I DEFAULT 10.
AT SELECTION-SCREEN OUTPUT.
  IF INIT IS INITIAL.
    INIT = 'X'.
    APPEND 'ONLI' TO IT_EXCLUDE.
    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
      EXPORTING
        P_STATUS  = SY-PFKEY
      TABLES
        P_EXCLUDE = IT_EXCLUDE.
  ENDIF.
  IF L_DOCKING IS INITIAL .
    CREATE OBJECT L_DOCKING
    EXPORTING
         REPID = SY-REPID
         DYNNR = SY-DYNNR
         SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
         EXTENSION = '300'
    EXCEPTIONS
         CNTL_ERROR                  = 1
         CNTL_SYSTEM_ERROR           = 2
         CREATE_ERROR                = 3
         LIFETIME_ERROR              = 4
         LIFETIME_DYNPRO_DYNPRO_LINK = 5.
  ENDIF .
  SELECT * FROM MARA INTO TABLE LT_MARA UP TO P_COUNT ROWS.
  IF L_ALV IS INITIAL.
    CREATE OBJECT L_ALV
      EXPORTING
        I_PARENT = L_DOCKING.
    CALL METHOD L_ALV->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
        I_STRUCTURE_NAME = 'MARA'
      CHANGING
        IT_OUTTAB        = LT_MARA.
  ELSE.
    CALL METHOD L_ALV->REFRESH_TABLE_DISPLAY.
  ENDIF.
阅读(844) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~