2008 May 14 2:16 PM
hi to all,
i want to make my table control enable & disable at runtime according to some logic.
at first in PBO i was tried to disabled column number 1 with help of this code.
LOOP AT TC_RISK_EX-COLS INTO D_TC_EXC WHERE INDEX = 1.
D_TC_EXC-SCREEN-INPUT = 0.
MODIFY TC_RISK_EX-COLS FROM D_TC_EXC INDEX SY-TABIX.
ENDLOOP.
but after that i was tried to make it enable with help of this code. but it is not working.
LOOP AT TC_RISK_EX-COLS INTO D_TC_EXC WHERE INDEX = 1.
D_TC_EXC-SCREEN-INPUT = 1.
MODIFY TC_RISK_EX-COLS FROM D_TC_EXC INDEX SY-TABIX.
ENDLOOP.
Is there any Solution for these ?
2008 May 14 3:24 PM
Hello.
It should work. Are you using both statements in PBO of the screen that contains Table Control?
I have a similar code, for example, to hide columns. As aditional info, use TRANSPORTING statement.
cols_in is a table with the fields to appear, like a variant construction.
PBO
* Retira colunas
LOOP AT table_control-cols INTO wa_cols.
READ TABLE cols_in WITH KEY field = wa_cols-screen-name+3.
CHECK sy-subrc NE 0.
wa_cols-invisible = '1'.
MODIFY table_control-cols FROM wa_cols TRANSPORTING invisible.
ENDLOOP.
* Insere colunas
LOOP AT table_control-cols INTO wa_cols WHERE invisible EQ '1'.
READ TABLE cols_in WITH KEY field = wa_cols-screen-name+3.
CHECK sy-subrc EQ 0.
wa_cols-invisible = space.
MODIFY table_control-cols FROM wa_cols TRANSPORTING invisible.
ENDLOOP.
Can you post all of the PBO module coding?
Best regards.
Valter Oliveira.
hi to all,
i want to make my table control enable & disable at runtime according to some logic.
at first in PBO i was tried to disabled column number 1 with help of this code.
LOOP AT TC_RISK_EX-COLS INTO D_TC_EXC WHERE INDEX = 1.
D_TC_EXC-SCREEN-INPUT = 0.
MODIFY TC_RISK_EX-COLS FROM D_TC_EXC INDEX SY-TABIX.
ENDLOOP.
but after that i was tried to make it enable with help of this code. but it is not working.
LOOP AT TC_RISK_EX-COLS INTO D_TC_EXC WHERE INDEX = 1.
D_TC_EXC-SCREEN-INPUT = 1.
MODIFY TC_RISK_EX-COLS FROM D_TC_EXC INDEX SY-TABIX.
ENDLOOP.
Is there any Solution for these ?
2008 May 14 3:24 PM
Hello.
It should work. Are you using both statements in PBO of the screen that contains Table Control?
I have a similar code, for example, to hide columns. As aditional info, use TRANSPORTING statement.
cols_in is a table with the fields to appear, like a variant construction.
PBO
* Retira colunas
LOOP AT table_control-cols INTO wa_cols.
READ TABLE cols_in WITH KEY field = wa_cols-screen-name+3.
CHECK sy-subrc NE 0.
wa_cols-invisible = '1'.
MODIFY table_control-cols FROM wa_cols TRANSPORTING invisible.
ENDLOOP.
* Insere colunas
LOOP AT table_control-cols INTO wa_cols WHERE invisible EQ '1'.
READ TABLE cols_in WITH KEY field = wa_cols-screen-name+3.
CHECK sy-subrc EQ 0.
wa_cols-invisible = space.
MODIFY table_control-cols FROM wa_cols TRANSPORTING invisible.
ENDLOOP.
Can you post all of the PBO module coding?
Best regards.
Valter Oliveira.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |