惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

博客园 - zhumk

Kindle DX/2最低程度中文化 ABAP:更新供应商Email地址 How to search for BAdIs IP41 - 维护计划中的日期和周期 如何升级Mac Mini(二代)内存 Kindle Collection编辑器 Kindle 汉化终结版 ABAP:密码输入框 SAP相关下载链接 ABAP:在Dynpro屏幕中使用Selection Screen BAPI:KBPP_EXTERN_UPDATE_CO, TCODE:CJ30/CJ40 第四部分 ALV popup based on classic style REUSE_ALV_POPUP_TO_SELECT function module ABAP: 如何让ALV Tree的注册事件在屏幕PAI之后触发 ABAP: Search Help for Date BAPI:KBPP_EXTERN_UPDATE_CO, TCODE:CJ30/CJ40 第三部分 BAPI:KBPP_EXTERN_UPDATE_CO, TCODE:CJ30/CJ40 第二部分 BAPI:KBPP_EXTERN_UPDATE_CO, TCODE:CJ30/CJ40 第一部分 ABAP:WBS Element下层预算向上层汇总 DynDNS免费动态域名解析
ABAP:运行中修改Table Control控件状态
zhumk · 2011-02-18 · via 博客园 - zhumk

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 .