ABAP:运行中修改Table Control控件状态
2011-02-18 18:02
567 查看
Dialog程序中,经常需要根据数据的不同,动态修改屏幕上控件的状态为只显示,隐藏,或者可编辑状态,以下为部分示例一、修改屏幕上控件状态(不包含TableControl内的子控件)对于此中情况,在Screen PBO事件下,
Manipulating individual abap dynpro table control field attributes
If you place the following ABAP into the ‘populate_screen’ PBO module (the PBO module within flow logic the table control loop) it will set the ‘EBELN’ field on the 2nd row to display only. The first bit of the code calculates which row is currently being processed, based on the current top viewable table control row. Once the desired row has been reached it performs ‘LOOP AT SCREEN’ to find the correct field and sets its attributes.
Using the example of a basic table control as your starting point please implement the following ABAP code changes:MODULE populate_screen OUTPUT. DATA: ld_line TYPE i. * Set which line of itab is at the top of the table control IF sy-stepl = 1. tc100-lines = tc100-top_line + sy-loopc - 1. ENDIF. * move fields from work area to scrren fields MOVE-CORRESPONDING wa_ekko TO ztc_ekko. ld_line = sy-stepl + tc100-top_line - 1. * Changes individual field attributes of table control, * Sets EBELN field on 3rd row of TC to not be an input field! LOOP AT SCREEN. IF ld_line EQ 3. IF screen-name EQ 'ZTC_EKKO-EBELN'. "一般用Group1-Group4组条件进行控制,一次可以对一批控件进行状态修改 screen-input = 0. MODIFY SCREEN. ENDIF. ENDIF. ENDLOOP. ENDMODULE. " populate_screen OUTPUT
二、修改Table Control内部子控件状态
controls: TC_ITEM type tableview using screen 0100.
field-symbols <FS_COLUMN> type CXTAB_COLUMN.
loop at TC_ITEM-COLS assigning <FS_COLUMN>. if <FS_COLUMN>-SCREEN-GROUP1 = 'G01'. <FS_COLUMN>-SCREEN-INPUT = '1'. endif. endloop .
相关文章推荐
- ABAP 的TABLE CONTROL实践积累
- 通过重构重命名修改项目名称后,运行状态栏显示旧项目名的解决办法
- 获取ListControl控件中(复选框)CheckBox的状态
- 如何用SC获得Windows Service的启动类型,运行状态, 修改启动类型
- TCustomControl绘制自己和图形子控件共四步,五种情况下会刷新控件状态(刷新控件状态才能刷新所有子FWinControls的显示),TWinControl关键属性方法速记
- 解决Win32 SDK编程添加list control控件程序无法运行的问题
- vc 修改控件ID出现运行异常的原因
- C# 1.Winform 同时修改多个config文件2.实时监测某程序运行状态(多线程),未启动时,自启。
- ***控件的视图状态(Control.ViewState)
- ABAP 表格控制(Table Control)和 步循环(STEP-LOOP) . .
- Tomcat运行状态下 修改Velocity嵌套的页面时报 java.lang.OutOfMemoryError: PermGen space及其解决方法
- ABAP 表格控制(Table Control)和步循环
- RHEL7 修改SSH默认端口及修改SELinux运行状态
- 【组件修改】winform某个tabcontrol控件的修改--加上关闭按钮
- WinForm------如何修改PanelControl控件背景色
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- HtmlControl 和 服务器端控件 和 运行在服务器端的htmlcontrol (runat=server) 的区别
- 控件修改状态
- panel 与treeview控件的结合实现tablecontrol功能