Chinaunix首页 | 论坛 | 博客
  • 博客访问: 202987
  • 博文数量: 49
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 520
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-24 09:35
文章分类

全部博文(49)

文章存档

2008年(49)

我的朋友

分类:

2008-03-27 10:31:52

将alv class的parent设为 cl_gui_container=>screen0.  表示第0个层次的屏幕.
 
1. 在报表中显示:
TABLES zstudent.
DATA itab LIKE TABLE OF zstudent.
DATA grid TYPE REF TO cl_gui_alv_grid.
START-OF-SELECTION.
  SELECT * FROM zstudent INTO TABLE itab.
  CREATE OBJECT grid
    EXPORTING
      i_parent          = cl_gui_container=>screen0     .
 
  CALL METHOD grid->set_table_for_first_display
    EXPORTING
      i_structure_name = 'ZSTUDENT'
    CHANGING
      it_outtab        = itab.
     
  WRITE ''. 
 
 
 
2. 在选择屏幕中显示:
REPORT  z_temp_demo.
TABLES zstudent.
DATA itab LIKE TABLE OF zstudent.
DATA grid TYPE REF TO cl_gui_alv_grid.
SELECTION-SCREEN BEGIN OF SCREEN 9999.
SELECTION-SCREEN END OF SCREEN 9999.
 
START-OF-SELECTION.
  SELECT * FROM zstudent INTO TABLE itab.
  CREATE OBJECT grid
    EXPORTING
      i_parent          = cl_gui_container=>screen0     .
 
  CALL METHOD grid->set_table_for_first_display
    EXPORTING
      i_structure_name = 'ZSTUDENT'
    CHANGING
      it_outtab        = itab.
  CALL SELECTION-SCREEN 9999.
 
阅读(1080) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~