SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Как скрыть часть полей экранной таблицы



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
den
Старший специалист
Старший специалист



Joined: 11 Oct 2007
Posts: 103

PostPosted: Fri Oct 12, 2007 8:42 am    Post subject: Как скрыть часть полей экранной таблицы Reply with quote

Привет!
Сделал экран с TableView. Нужно, чтобы в некоторых строках были закрыты поля для ввода в зависимости от условия.
Пробовал скрывать поля в LOOP AT SCREEN, но эффект нулевой. Crying or Very sad
Back to top
View user's profile Send private message
july7
Старший специалист
Старший специалист



Joined: 10 Oct 2007
Posts: 109
Location: Киров

PostPosted: Fri Oct 12, 2007 10:11 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Fri Oct 12, 2007 10:48 pm    Post subject: Reply with quote

Вот еще пример:

В логике экрана пишешь:

Code:

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.
Back to top
View user's profile Send private message
mvs87
Участник
Участник



Joined: 25 Feb 2009
Posts: 34

PostPosted: Mon Jun 02, 2014 1:50 pm    Post subject: Reply with quote

Lord wrote:
Вот еще пример:

В логике экрана пишешь:

Code:

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.

DATA: table_view_row TYPE cxtab_column.

_________________
С уважением, mvs87.
Back to top
View user's profile Send private message
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Wed Jun 04, 2014 8:14 pm    Post subject: Reply with quote

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.

Не поздновато? Smile

_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
mvs87
Участник
Участник



Joined: 25 Feb 2009
Posts: 34

PostPosted: Thu Jun 05, 2014 6:17 am    Post subject: Reply with quote

Удав wrote:

Не поздновато? Smile[/quote]
Ну да, лет на 5 задержался. Но, скрыть поле никогда не поздно)

_________________
С уважением, mvs87.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.