ABAP: modifying the status of the table control while running

Source: Internet
Author: User

DialogProgramIn, you often need to dynamically modify the status of the control on the screen to show, hide, or editable based on different data. The following are some examples

1. Modify the control status on the screen (excluding child controls in tablecontrol)

In this case, in the screen PbO event,

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 '. " generally, the Group1-Group4 group conditions are used to control the status of a batch of controls at a time.  screen-input = 0. modify screen. endif. endif. endloop.  endmodule. "populate_screen output 
2. Modify the Status of the Child control in Table Control
 
Controls: tc_itemTypeTableviewUsingScreen0100.
    Field-Symbols  
     
      type  cxtab_column. 
     
      loop   at  TC_ITEM-COLS  assigning 
      
     
      . 
      
If -SCREEN-GROUP1 = 'g01' .
-screen-input = '1' .
endif.
endloop .
    

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.