06-19-2007 1:14 PM
Hi experts,
how can i change the table control first row(not column!) as editable mode and rest of the rows(not columns!) in display mode .One entry(user key in) will come in this table control.
PBO
<b>loop at it_tab into wa_tab with control tc_msg .
ENDLOOP.</b>
Points rewarded for helpful answer.<b></b>
06-19-2007 1:38 PM
Hi,
it is possible.Check out the following code.
PROCESS BEFORE OUTPUT.
MODULE tc2_change_tc_attr.
LOOP AT it_marc INTO x_marc WITH CONTROL tc2 CURSOR tc2-current_line.
MODULE tc2_get_lines.
ENDLOOP.
MODULE tc2_get_lines OUTPUT.
g_tc2_lines = sy-loopc.
IF tc2-current_line = 1.
LOOP AT SCREEN.
IF screen-group1 = 'G1'. -
<" Set the group name1 as G1 for all the table control fields----
>
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
06-19-2007 1:25 PM
Highlight individual table control field
The example below sets the EBELN field on the 1rd row of the table control to be an input field. This is a fairly simple process which involves firstly calculating which row of the internal table is displayed at the top of the table control. From this you can work out which itab row is on the 1st row and set its attributes using the LOOP AT SCREEN command.
Based on the example table control the ABAP code for this will be as follows, resulting in a modified version of the PBO MODULE 'populate_screen'.
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 1.
IF screen-name EQ 'ZTC_EKKO-EBELN'. " if you comment this if then full row
screen-input = X.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
ENDMODULE.
reward points if it is usefull ....
Girish
06-19-2007 2:43 PM
Hi Gireesh,
Thanks .solved my problem based on the logic.
rgds
shibu
06-19-2007 1:26 PM
Hi,
I don't think in table control it is possible to make one row editable..U can do it for column.
Regards,
Nagaraj
06-19-2007 1:38 PM
Hi,
it is possible.Check out the following code.
PROCESS BEFORE OUTPUT.
MODULE tc2_change_tc_attr.
LOOP AT it_marc INTO x_marc WITH CONTROL tc2 CURSOR tc2-current_line.
MODULE tc2_get_lines.
ENDLOOP.
MODULE tc2_get_lines OUTPUT.
g_tc2_lines = sy-loopc.
IF tc2-current_line = 1.
LOOP AT SCREEN.
IF screen-group1 = 'G1'. -
<" Set the group name1 as G1 for all the table control fields----
>
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
06-19-2007 2:44 PM
06-20-2007 9:12 AM