‎2006 Dec 11 8:23 PM
Hi,
I have table control have 10 columns . My requirement is i need to make the
alternative row cells in display mode.
ie i need to convert the
1st row 3rd column,
3rd row 5th column
5th row 3rd column
7th row 5th column .............like that
I am using the following code to make this happen
loop at tabcntl7-cols into i_cols.
v_tabix1 = sy-tabix.
condense i_cols-screen-name no-gaps.
v_strlen = strlen( i_cols-screen-name ).
search i_cols-screen-name for '-'.
if sy-subrc eq c_0.
v_sstrg = sy-fdpos + c_1.
v_strlen = v_strlen - v_sstrg.
endif.
move i_cols-screen-name+v_sstrg(v_strlen) to v_scrfld.
read table i_yfe047_1 into wa_yfe047_1
with key fieldname = v_scrfld.
if sy-subrc eq c_0.
i_cols-screen-input = c_off.
else.
i_cols-screen-input = c_on.
endif.
modify tabcntl7-cols from i_cols index v_tabix1.
endloop.
But currently system changing all rows to display mode.
Any suggestions?
Thanks
aRs
‎2006 Dec 11 8:38 PM
Put the fields you want to be display only into a field group on the screen painter. Then in the PBO:
LOOP AT SCREEN.
IF screen-group1 = '001'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Rob
‎2006 Dec 11 9:05 PM
Rob,
Can you please explain if we use Loop at screen in table control whether it will work?
Thanks
aRs
‎2006 Dec 11 9:13 PM
Like this:
process before output.
* Set screen attributes for table control
LOOP AT itab_0100 with control itabctl
cursor itabctl-top_line.
MODULE modify_screen_0100.
ENDLOOP.
MODULE modify_screen_0100 OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = '001'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
In the LOOP AT SCREEN, you can add logic to determine if you want to make it display or not. In this way, you can have any field in the table control open for input or display only.
Rob
Message was edited by:
Rob Burbank
‎2006 Dec 11 9:14 PM
Hi,
Give the LOOP AT SCREEN..ENDLOOP.. Inside the LOOP AT ITAB ..ENDLOOP. of the PBO..
LOOP AT ITAB WITH CONTROL TC..
MODULE DISABLE.
ENDLOOP.
MODULE DISABLE.
LOOP AT SCREEN.
....
ENDLOOP.
ENDMODULE.
Thanks,
Naren