Ansicht
Dokumentation

ABAPCONTROLS_TABLEVIEW - CONTROLS TABLEVIEW

ABAPCONTROLS_TABLEVIEW - CONTROLS TABLEVIEW

RFUMSV00 - Advance Return for Tax on Sales/Purchases   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

CONTROLS, TYPE TABLEVIEW

Short Reference



CONTROLS contrl TYPE TABLEVIEW USING SCREEN dynnr.

Effect

Declares a table control. If the type TABLEVIEW is specified in the statement CONTROLS, a deep structure is created with the name of the control and the type cxtab_control of the type pool CXTAB. In dynpro processing, the components of the structure contain the attributes of the table control. Using this structure, the attributes of the relevant table control can be changed and read.

At the top level, the deep structure cxtab_control contains components for the general attributes of the table control. The component cols is an internal table of the structure cxtab_column and contains the attributes of individual columns. The structure cxtab_column contains a structured component SCREEN of the type SCREEN. This component contains the attributes of the screen element of each column. Apart from the component current_line, all components of the structure cxtab_control can be set in the ABAP program.

dynnr expects the number of a dynpro on which a table control with the name contrl is defined. A literal or a constant of the type n with length 4 can be specified for dynnr. When a dynpro in which a table control called contrl is defined is called for the first time, the start values of certain components of the structure are taken from the definition of the table control whose dynpro is specified after USING.

The Structure cxtab_control

Component Meaning
fixed_cols Number of lead columns. The start value is taken from the definition of the table control in the dynpro dynnr.
LINES Controls the vertical scroll bar of the table control. If the LOOP is executed in the dynpro flow logic without reference to an internal table, that start value of LINES is 0 and must be set in the program so that the scroll bar can be used. With reference to an internal table, LINES is set to the current number of lines in the internal table if the table control is being processed for the first time. However, since this event is not defined, the value of LINES should also be explicitly set to the number of lines of the internal table before the PBO processing in this case.
top_line Top displayed line for next PBO. Set at time of PAI by the position of the vertical slider box.
current_line Current line during a LOOP in the dynpro flow logic. If the addition FROM of the statement LOOP is not specified, the value of current_line corresponds to the result of sy-stepl + (top_line - 1).
left_col Number of first horizontally scrollable column displayed after the lead columns. Is set at time of PAI by the position of the horizontal slider box.
line_sel_mode Line selection mode: "0" if no lines can be selected, "1" if one line, "2" if multiple lines. The start value is taken from the definition of the table control in the dynpro dynnr.
lcol_sel_mode Column selection mode: "0" if no columns can be selected, "1" if one column, "2" if multiple columns. The start value is taken from the definition of the table control in the dynpro dynnr.
line_selector Flag ("X" or " ") indicating whether there is a selection column. The start value is taken from the definition of the table control in the dynpro dynnr.
h_grid Flag ("X" or " ") indicating whether there are horizontal separators. The start value is taken from the definition of the table control in the dynpro dynnr.
v_grid Flag ("X" or " ") indicating whether there are vertical separators. The start value is taken from the definition of the table control in the dynpro dynnr.
cols Control table for individual columns of the structure cxtab_column.
invisible Flag ("X" or " ") indicating whether the table control is visible in the GUI window.

The Structure cxtab_column

Component Meaning
screen Structure for the attributes of the screen element of the current column. The components can be set for the values described there either directly or using MODIFY SCREEN. MODIFY SCREEN overwrites a direct assignment.
index Current position of the column in the table control. The start value is taken from the definition of the table control in the dynpro dynnr. Is set to current value at time of PAI.
selected Flag ("X" or " ") indicating whether the column is selected. Is set to current value at time of PAI.
vislength Visible length of the column. Start value is taken from the definition of the table control in dynpro dynnr.
invisible Flag ("X" or " ") indicating whether the column is visible in the table control.

Notes

  • In a table control, it is possible to scroll vertically using a scroll bar if the component LINES of the structure cxtab_control was set to the correct line number before the PBO processing of the table control. Every time the scroll bar is scrolled, the event PAI is raised with an empty function code and the component top_line of the structure cxtab_control is automatically set to the new top line before PBO.
  • For program-driven scrolling, it is sufficient to assign a value to the component top_line of the structure cxtab_control during PBO processing. When scrolling by page, the number of lines scrolled can be taken from the system field sy-loopc in loop executions. sy-loopc contains the number of currently displayed lines and the component LINES of the structure cxtab_control contains the number of lines in the entire table control.

Example

If a table control is defined on the dynpro with the number 100 and the lines of this table control are defined with reference to the DDIC database table SPFLI in the ABAP Dictionary, the corresponding programming of the ABAP program can be as follows. In a PBO module prepare_tab, an internal table spfli_tab is filled with data from the database table. The number of lines of spfli_tab is assigned to the component lines of the structure flight_tab created using CONTROLS to activate the scroll bar of the table control. In a PAI module modify_tab, the line of the internal table is modified whose primary table key matches that of the interface work area spfli defined using TABLES. The PAI module modify_tab is called for every displayed line of the table control. The corresponding dynpro flow logic can be seen in the example for LOOP.






CL_GUI_FRONTEND_SERVICES - Frontend Services   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 10678 Date: 20240426 Time: 175025     sap01-206 ( 171 ms )