Posted: Fri Oct 12, 2007 8:42 am Post subject: Как скрыть часть полей экранной таблицы
Привет!
Сделал экран с TableView. Нужно, чтобы в некоторых строках были закрыты поля для ввода в зависимости от условия.
Пробовал скрывать поля в LOOP AT SCREEN, но эффект нулевой.
CONTROLS: tab_docs TYPE TABLEVIEW USING SCREEN '9001'.
в PBO модуле пишешь:
data: l_column like line of tab_docs-cols.
loop at tab_docs-cols
into l_column.
if l_column-screen-name = 'MYTABLENAME-MYFIELDNAME'.
IF ....
l_column-invisible = 'X'.
ELSE.
clear: l_column-invisible.
ENDIF.
modify tab_docs-cols from l_column.
endif.
endloop.
LOOP AT screen100 WITH CONTROL table CURSOR top.
MODULE update_table_pbo.
ENDLOOP.
В модуле:
Code:
LOOP AT SCREEN.
IF l_error = true.
screen-intensified = '1'.
ELSE.
screen-intensified = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Если хочешь отдельные колонки таблицы вообще скрыть или показать тогда в PBO-логике вызов модуля, пишешь (в цикле его вызывать не надо):
Code:
DATA: grid_view_row TYPE cxtab_column.
LOOP AT table-cols INTO table_view_row.
IF grid_view_row-screen-group1 = 'GR1'.
grid_view_row-invisible = '1'.
ELSEIF grid_view_row-screen-group1 = 'GR2'.
grid_view_row-invisible = '0'.
ENDIF.
MODIFY table-cols INDEX sy-tabix FROM grid_view_row.
ENDLOOP.
add:
Structure:
Code:
TYPES: BEGIN OF CXTAB_COLUMN,
SCREEN LIKE SCREEN, "Attributes struktur SCREEN
INDEX TYPE I, "Position of a column on the screen
SELECTED(1) TYPE C, "Indicator 'column selected'
VISLENGTH LIKE ICON-OLENG, "Visualised length of a column
INVISIBLE(1) TYPE C, "Indicator 'column invisible'
END OF CXTAB_COLUMN.
Age: 48 Joined: 25 Jan 2008 Posts: 580 Location: Москва
Posted: Wed Jun 04, 2014 8:14 pm Post subject:
mvs87 wrote:
add:
Structure:
Code:
TYPES: BEGIN OF CXTAB_COLUMN,
SCREEN LIKE SCREEN, "Attributes struktur SCREEN
INDEX TYPE I, "Position of a column on the screen
SELECTED(1) TYPE C, "Indicator 'column selected'
VISLENGTH LIKE ICON-OLENG, "Visualised length of a column
INVISIBLE(1) TYPE C, "Indicator 'column invisible'
END OF CXTAB_COLUMN.
DATA: table_view_row TYPE cxtab_column.
Не поздновато? _________________ С уважением,
Удав.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.