Chinaunix首页 | 论坛 | 博客
  • 博客访问: 702417
  • 博文数量: 158
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1643
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-11 14:37
个人简介

人法地,地法天,天法道,道法自然

文章分类

全部博文(158)

文章存档

2022年(1)

2020年(3)

2016年(1)

2014年(7)

2013年(4)

2010年(5)

2009年(86)

2008年(25)

2007年(26)

我的朋友

分类:

2009-05-06 16:10:39

Table Control设计

 

Tabstrip设计:

子屏幕设计:

最终结果:

子屏幕中设计TC的代码:




REPORT ZTEST_S .

tables:zsd19info.

CONTROLS MYTAB TYPE TABSTRIP.

CONTROLS MYTABCONT TYPE TABLEVIEW USING SCREEN 110.
DATA: ok_code TYPE sy-ucomm,
      save_ok 
TYPE sy-ucomm.

DATA  number TYPE sy-dynnr.

data : fill type i,
       
lines type i,
       limit 
type i.

 
FIELD-SYMBOLS       TYPE I.
 
data: g_mytabcont_lines  like sy-loopc,
       l_tc_lines_name       
like feld-name.


mytab-activetab = 
'PUSH2'.

data : begin of tc_info occurs 0,
         xuhao 
type i,
         extwg 
like zsd19info-extwg,
         maktt 
like zsd19info-maktt,
       
end of tc_info.
data:title type string,
     itab 
like table of tc_info with header line.

call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module STATUS_0100 output.
   
SET PF-STATUS 'SCREEN_100'.
   
perform TC_INFO_INIT.
endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.
 save_ok = ok_code.

* MESSAGE SAVE_OK TYPE 'S' .
  
CLEAR ok_code.
  
IF save_ok = 'OK'.
    
MESSAGE i888(sabapdocu) WITH 'MYTABSTRIP-ACTIVETAB ='
                                  mytab-activetab.
  
ELSE.
    mytab-activetab = save_ok.
    
CASE save_ok.
      
WHEN 'PUSH1'.
        
number = '0110'.
      
WHEN 'PUSH2'.
        
number = '0120'.
      
WHEN 'PUSH3'.
        
number = '0130'.
      
when 'BACK'  .
        
LEAVE PROGRAM.
    
ENDCASE.
  
ENDIF.
endmodule.                 " USER_COMMAND_0100  INPUT

MODULE read_table_control INPUT.
  
MODIFY itab FROM tc_info INDEX mytabcont-current_line.
ENDMODULE.

*&---------------------------------------------------------------------*
*&      Module  CANCEL  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module CANCEL input.
  
LEAVE PROGRAM.
endmodule.                 " CANCEL  INPUT

form TC_INFO_INIT.
clear tc_info[].
clear itab[].
*clear t_chuk.
*read table  index index.
select * from zsd19info into corresponding fields of table itab .

loop at itab.
  itab-xuhao = sy-tabix.
  
modify itab index sy-tabix.
endloop.

DESCRIBE TABLE ITAB LINES fill.
mytabcont-
lines = fill.
endform.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0110  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0110 input.
 save_ok = ok_code.
 
CLEAR ok_code.

* CONCATENATE 'G_' 'MYTABCONT' '_LINES' INTO L_TC_LINES_NAME.
* ASSIGN (L_TC_LINES_NAME) TO .
* lines =  .

 
CASE save_ok.
   
when 'FIRST_PAGE'.
         mytabcont-top_line = 
0.
   
when 'PREV_PAGE'.
         mytabcont-top_line = mytabcont-top_line - 
lines.
         
if mytabcont-top_line < 0.
            mytabcont-top_line = 
0.
         
endif.
   
when 'PREV_LINE'.
         mytabcont-top_line = mytabcont-top_line - 
1.
         
if mytabcont-top_line < 0.
            mytabcont-top_line = 
0.
         
endif.
   
when 'NEXT_LINE'.
          mytabcont-top_line = mytabcont-top_line + 
1.
          limit = fill - 
lines + 1.
          
if mytabcont-top_line > limit.
             mytabcont-top_line = limit.
          
endif.
   
when 'NEXT_PAGE'.
          mytabcont-top_line = mytabcont-top_line + 
lines.
          limit = fill - 
lines + 1 .
          
if mytabcont-top_line > limit .
              mytabcont-top_line = limit.
          
endif.
   
when 'LAST_PAGE'.
          mytabcont-top_line =  fill - 
lines + 1.
   
when 'EXP' .
         
message '导出' type 'I' .
 
ENDCASE.

endmodule.                 " USER_COMMAND_0110  INPUT
*&---------------------------------------------------------------------*
*&      Module  GET_LINES  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module get_lines output.  "屏幕中可见的行号,也就是每页能显示的行数
*    g_mytabcont_lines = sy-loopc.
    
lines = sy-loopc.
endmodule.                 " GET_LINES  OUTPUT

阅读(782) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~