‎2008 Apr 24 6:45 PM
Hi all,
I have a problem concerning a screen - it is so that the screen is used by several transactions - Create 'plan', Display 'plan' and Change 'plan'.
When it's called from the 'Display' transaction I want the screen to be output-only. So I wrote something like this:
MODULE modify_screen OUTPUT.
if sy-tcode = 'ZAF03'.
loop at screen.
if screen-name cp 'I_AFPL*'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
ENDMODULE.
The problem is that this screen contains a tabstrip control. The subscreens on the pages of the tabstrip control contain table controls, and the table controls refer to some internal tables in the program.
All the fields which I want to make 'output only' are fields of internal tables beginning with 'I_AFPL' that's why the condition...
This works very well for the fields on the main screen, but not for the fields of the table controls on the tabstrip control... and I'm calling that module from the main screen and also from the subscreens of the 'pages' of the tabstrip control. In the debugger I see that the input is set to 0 but when the screen 'comes on screen' I can still do input in those fields...
Can anyone tell me what I'm doing wrong?
Thanks,
‎2008 Apr 27 6:39 AM
Hi Ashish,
for table control to disable a column we use the cols property in the screen'..the tablecontrol-cols is set to zero to inactivate a column
Now assume the name of your table control is ZTABLECONT..double click on the screen painter on the table control..these 2 names must be the same....
if you need to disable columns of table control as a part of user action..like say click of a button..it can be entered in PAI by checking the sy-ucomm
data declaration:
data : cols like line of ZTABLECONT-cols.
Case sy-ucomm.
when 'PUSH'.
loop at ZTABLECONT-cols into cols.
if cols-screen-input = '1'.
cols-screen-input = '0'.
endif.
modify ZTABLECONT-cols from cols index sy-tabix.
endloop.
endcase.
This will disable all the columns
for a particular column do the following
For this imagine you have 5 columns
in the below code
index = 1 => column 1
index = 2 => column 2
index = 3 => column 3
index = 4 => column 4
index = 5 => column 5
in the below code , only column2 will be disabled....
so whicever column you want to disable ..just give the index
for multiple disabling..just write the code accordingly
LOOP AT ZTABLECONT-cols INTO cols WHERE index = 2.
IF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY ZTABLECONT-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Pls check and revert....
Regards
Byju
‎2008 Apr 24 6:59 PM
In the PBO routine you should have code that looks like this
PROCESS BEFORE OUTPUT.
*&spwizard: pbo flow logic for tablecontrol 'TBLCLT_MAIN'
module TBLCLT_MAIN_change_tc_attr.
*&spwizard: module TBLCLT_MAIN_change_col_attr.
loop at IT_WK
into WK_REC
with control TBLCLT_MAIN
cursor TBLCLT_MAIN-current_line.
*&spwizard: module TBLCLT_MAIN_change_field_attr " your table cell attributes can be set here
endloop.
Edited by: Paul Chapman on Apr 24, 2008 7:59 PM
‎2008 Apr 26 7:31 PM
Hello.
Did you call the MODULE in the LOOP of the table control?
Otherwise it didn't work!
There is another possiblity to do this. This is described also in the
documentation for TableControls.
(Have a look at Fields of CXTAB*)
Example Program for Table Control from SAP: RSDEMO02
Regards
‎2008 Apr 27 6:39 AM
Hi Ashish,
for table control to disable a column we use the cols property in the screen'..the tablecontrol-cols is set to zero to inactivate a column
Now assume the name of your table control is ZTABLECONT..double click on the screen painter on the table control..these 2 names must be the same....
if you need to disable columns of table control as a part of user action..like say click of a button..it can be entered in PAI by checking the sy-ucomm
data declaration:
data : cols like line of ZTABLECONT-cols.
Case sy-ucomm.
when 'PUSH'.
loop at ZTABLECONT-cols into cols.
if cols-screen-input = '1'.
cols-screen-input = '0'.
endif.
modify ZTABLECONT-cols from cols index sy-tabix.
endloop.
endcase.
This will disable all the columns
for a particular column do the following
For this imagine you have 5 columns
in the below code
index = 1 => column 1
index = 2 => column 2
index = 3 => column 3
index = 4 => column 4
index = 5 => column 5
in the below code , only column2 will be disabled....
so whicever column you want to disable ..just give the index
for multiple disabling..just write the code accordingly
LOOP AT ZTABLECONT-cols INTO cols WHERE index = 2.
IF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY ZTABLECONT-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Pls check and revert....
Regards
Byju