博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

李海鑫的SAP博客

  lihaixin.cublog.cn

关于作者
姓名:
职业:
年龄:
位置:
个性介绍:
|| << >> ||
我的分类


实现 container bar
*&---------------------------------------------------------------------*
*& Report  Z_TEMP_DEMO5
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT  z_temp_demo5.
DATA: ok_code LIKE sy-ucomm,
      save_ok LIKE ok_code,
      container_bar TYPE REF TO cl_gui_container_bar,
      dock_container TYPE REF TO cl_gui_docking_container,
      text_edit TYPE REF TO cl_gui_textedit,
      cell_container TYPE REF TO cl_gui_container,
      grid TYPE REF TO cl_gui_alv_grid.
DATA: captions TYPE sbptcaptns,
      captions2 LIKE captions,
      caption LIKE LINE OF captions.
DATA: itab TYPE TABLE OF zstudent.
 

START-OF-SELECTION.
  SELECT * FROM zstudent INTO TABLE itab.
  caption-caption = ' Singel'.
  caption-icon = '@12@'.
  APPEND caption TO captions.
  caption-caption = ' Lee'.
  caption-icon = '@13@'.
  APPEND caption TO captions.
  caption-caption = ' Eason'.
  caption-icon = '@14@'.
  APPEND caption TO captions.

  caption-caption = ' Course'.
  caption-icon = '@15@'.
  APPEND caption TO captions2.
  caption-caption = ' Score'.
  caption-icon = '@16@'.
  APPEND caption TO captions2.

  CALL SCREEN 9000.
 
 
 
 
 

*&---------------------------------------------------------------------*
*&      Module  STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
  SET PF-STATUS 'STATUS_9000'.
*  SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*&      Module  init_container  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE init_container OUTPUT.
  IF dock_container IS INITIAL.
    CREATE OBJECT dock_container
      EXPORTING
        extension                   = 300
        .
    CREATE OBJECT container_bar
      EXPORTING
        active_id                    = 2
        captions                     = captions
        parent                       = dock_container .

    CALL METHOD container_bar->get_container
      EXPORTING
        id        = 1
      RECEIVING
        container = cell_container.

    CREATE OBJECT text_edit
    EXPORTING
      parent                 = cell_container  .

    CALL METHOD container_bar->get_container
      EXPORTING
        id        = 2
      RECEIVING
        container = cell_container.

    CREATE OBJECT grid
      EXPORTING
        i_parent          = cell_container      .
    CALL METHOD grid->set_table_for_first_display
      EXPORTING
        I_STRUCTURE_NAME              = 'ZSTUDENT'
      CHANGING
        it_outtab                     = itab
            .

  ENDIF.
ENDMODULE.                 " init_container  OUTPUT

发表于: 2008-05-07,修改于: 2008-05-07 18:12,已浏览91次,有评论0条 推荐 投诉


网友评论
 发表评论