2007 Jun 29 6:34 AM
Hi,
I have TC on subscreen and need to change single cell with amount to be able for input data depending status in another field. This can be done in some rows in some not. Field in screen painter is seted on INPUT = 1.
my code looks like this:
PBO:
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if screen-name = 'AMOUNT'.
if plast = 'X'.
screen-input = 1.
screen-output = 1.
screen-active = 1.
else.
screen-input = 0.
screen-output = 1.
screen-active = 1.
endif.
endif.
modify screen.
endloop.
endmodule. Where is the problem?
2007 Jun 29 7:48 AM
Try this..
PBO:
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if screen-name = 'AMOUNT'.
if plast = 'X'.
screen-input = 1.
screen-output = 1.
screen-active = 1.
else.
screen-input = 0.
screen-output = 1.
screen-active = 1.
endif.
else.
screen-input = 0.
endif.
modify screen.
endloop.
endmodule.
Try this..
PBO:
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if screen-name = 'AMOUNT'.
if plast = 'X'.
screen-input = 1.
screen-output = 1.
screen-active = 1.
else.
screen-input = 0.
screen-output = 1.
screen-active = 1.
endif.
else.
screen-input = 0.
endif.
modify screen.
endloop.
endmodule.
2007 Jun 29 7:40 AM
Hi ... i did changes on your code .... seee the first one i guess you have to padd the excat field name you can see the next code of myin where i pass the field with internal table .
<b>my code of yours</b>
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if plast = 'X'.
if screen-name = 'AMOUNT'.
screen-input = 1.
modify screen.
endif.
endif.
endloop.
endmodule.
<b>my code of sample :</b>
MODULE populate_screen OUTPUT.
DATA: ld_line TYPE i.
* Set which line of itab is at the top of the table control
IF sy-stepl = 1.
tc100-lines =
tc100-top_line + sy-loopc - 1.
ENDIF.
* move fields from work area to scrren fields
MOVE-CORRESPONDING wa_ekko TO ztc_ekko.
ld_line = sy-stepl + tc100-top_line - 1.
* Changes individual field attributes of table control,
* Sets EBELN field on 3rd row of TC to not be an input field!
LOOP AT SCREEN.
IF ld_line EQ 3.
IF screen-name EQ 'ZTC_EKKO-EBELN'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
ENDMODULE. " populate_screen OUTPUT
reward points if it is usefull .....
Girish
2007 Jun 29 7:48 AM
Try this..
PBO:
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if screen-name = 'AMOUNT'.
if plast = 'X'.
screen-input = 1.
screen-output = 1.
screen-active = 1.
else.
screen-input = 0.
screen-output = 1.
screen-active = 1.
endif.
else.
screen-input = 0.
endif.
modify screen.
endloop.
endmodule.
2007 Jun 29 8:27 AM
2007 Jun 29 11:08 AM
In a table control, you cannot make a single cell or row read_only or editable. If you do screen-input = 1/0 it will work at the entire column level. For this requirement, use an ALV it will work.
Regards,
Nithya
2007 Jun 29 11:13 AM
Hi,
If you know line no.,here is the sample code.
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSEIF ( flg EQ 'Y' ).
IF ( ( screen-name = 'I_MAKT-ZMAKTX'
OR screen-name = 'I_MAKT-CHECK1' )
AND t_ctrl-current_line LE ln ) .
Making the screen fields as editable
screen-input = 1.
ELSEIF ( ( screen-name = 'I_MAKT-ZMATNR' )
AND t_ctrl-current_line LE ln ).
Making the screen field as uneditable
screen-input = 0.
ENDIF.
ENDIF.
Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
2007 Jun 29 11:16 AM
solved, i deactivated some perform which always sets my field to be only output....sorry
2007 Jun 29 11:22 AM
Hi,
Change it like this.I think the screen name for AMOUNT field of table control is
WA-AMOUNT.In Loop at screen ,you got to pass the full name of the field.And this <b>plast</b> field also should be one of the field in that itab structure.What you can
Chk out corrected code.
PBO:
loop at it into wa
with control tab_ctrl.
module data_transfer.
module change_cell.
endloop.
module change_cell.
loop at screen.
if screen-name = 'WA-AMOUNT'.
<b> If WA-PLAST = 'X'.</b>
screen-input = 1.
screen-output = 1.
screen-active = 1.
else.
screen-input = 0.
screen-output = 1.
screen-active = 1.
endif.
endif.
modify screen.
endloop.
endmodule.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |