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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 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 .