‎2007 Feb 20 6:34 AM
i have 10 colums in table control. How can i make the 2 columns invisible in PBO based upon a transaction.
‎2007 Feb 20 6:39 AM
Hi,
Check the Table Control Properties to do this.
You can also try using LOOP AT SCREEN... MODIFY SCREEN...ENDLOOP.
Regards,
Anji
‎2007 Feb 20 6:41 AM
‎2007 Feb 20 6:55 AM
‎2007 Feb 20 6:55 AM
See the following ex: code.
Assign group name to table control field in screen painter.
PROCESS BEFORE OUTPUT.
*&SPWIZARD: MODULE TC2_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC2_CHANGE_COL_ATTR.
LOOP AT G_TC2_ITAB
INTO G_TC2_WA
WITH CONTROL TC2
CURSOR TC2-CURRENT_LINE.
*&SPWIZARD: MODULE TC2_CHANGE_FIELD_ATTR
MODULE TC2_MOVE.
MODULE TC2_GET_LINES.
MODULE CHECK_AUTH.
ENDLOOP.
&----
*& Module CHECK_AUTH OUTPUT
&----
text
----
MODULE CHECK_AUTH OUTPUT.
DATA: BM_APP,
RM_APP,
NSM_APP.
CLEAR: BM_APP, RM_APP, NSM_APP.
IF NOT G_TC2_ITAB[] IS INITIAL.
READ TABLE G_TC2_ITAB INDEX 1 INTO G_TC2_WA1.
IF SY-SUBRC = 0.
SELECT SINGLE * FROM ZSD_RBT_APPRV
WHERE GJAHR = G_TC2_WA1-GJAHR
AND KNUMA = G_TC2_WA1-KNUMA.
IF SY-SUBRC = 0.
IF ZSD_RBT_APPRV-BM_APP = 'C'.
BM_APP = 'C'.
ENDIF.
IF ZSD_RBT_APPRV-RM_APP = 'C'.
RM_APP = 'C'.
ENDIF.
IF ZSD_RBT_APPRV-NSM_APP = 'C'.
NSM_APP = 'C'.
ENDIF.
ELSE.
CLEAR : BM_APP,
RM_APP,
NSM_APP.
ENDIF.
ENDIF.
ENDIF.
LOOP AT SCREEN.
IF NOT G_AUTH IS INITIAL.
if g_auth = 'BM'.
if screen-group1 = 'RM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'NSM'.
SCREEN-INPUT = '0'.
endif.
IF BM_APP = 'C'.
if screen-group1 = 'BM'.
screen-input = '0'.
endif.
endif.
elseif g_auth = 'RM'.
if screen-group1 = 'BM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'NSM'.
SCREEN-INPUT = '0'.
endif.
IF RM_APP = 'C'.
if screen-group1 = 'RM'.
screen-input = '0'.
endif.
endif.
IF BM_APP <> 'C'.
if screen-group1 = 'RM'.
screen-input = '0'.
endif.
endif.
elseif g_auth = 'NSM'.
if screen-group1 = 'BM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'RM'.
SCREEN-INPUT = '0'.
endif.
IF NSM_APP = 'C'.
if screen-group1 = 'NSM'.
screen-input = '0'.
endif.
endif.
IF BM_APP <> 'C'.
if screen-group1 = 'NSM'.
screen-input = '0'.
endif.
endif.
IF RM_APP <> 'C'.
if screen-group1 = 'NSM'.
screen-input = '0'.
endif.
endif.
modify screen.
ELSE.
if screen-group1 = 'RM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'BM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'NSM'.
SCREEN-INPUT = '0'.
endif.
modify screen.
endif.
ELSE.
if screen-group1 = 'BM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'RM'.
SCREEN-INPUT = '0'.
endif.
if screen-group1 = 'NSM'.
SCREEN-INPUT = '0'.
endif.
modify screen.
ENDIF.
modify screen.
endloop.
ENDMODULE. " CHECK_AUTH OUTPUT