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 .