06-07-2007 12:04 PM
Hi,
I am developing a program using dialog programming. I have a table control, and I want to use some rows as uneditable. The purpose of this, user can see some records that have entered before, and user should not change before data, but should enter new data. So, I need that I want to make uneditable some rows. Is it possible?
Thanks.
06-07-2007 12:11 PM
Hi,
Sure you can do some rows as uneditable.You should have some condition to satisfy.Based on the condition you can set that in PBO module inside loop endloop in flow logic.
PROCESS BEFORE OUTPUT.
LOOP AT it_t001l INTO x_t001l
WITH CONTROL tc
CURSOR tc-current_line.
MODULE tc_get_lines.
*&SPWIZARD: MODULE TC_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE tc_get_lines OUTPUT.
g_tc_lines = sy-loopc.
IF tc-current_line = 3.
LOOP AT SCREEN.
IF screen-group1 = 'TCFL'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. "TC_GET_LINES OUTPUT
Here screen group 'TCFL' has to be set for all the table control fields.Her i have set the 3rd row as display only.
Message was edited by:
Vigneswaran S
06-07-2007 12:07 PM
Hi Azad,
Double click the Screen fields. One POP up will come.
Select Screen Atttributes -> Programs -> Input -> Not Possible.
Thanks.
Reward If Helpful.
06-07-2007 12:10 PM
thanks viji..
but it cant be possible..because itshould be disabled on the bases of rows in internal table..
the already existing in the table shud come under disable and blank rows shud be insertable.
06-07-2007 12:11 PM
Hi,
Sure you can do some rows as uneditable.You should have some condition to satisfy.Based on the condition you can set that in PBO module inside loop endloop in flow logic.
PROCESS BEFORE OUTPUT.
LOOP AT it_t001l INTO x_t001l
WITH CONTROL tc
CURSOR tc-current_line.
MODULE tc_get_lines.
*&SPWIZARD: MODULE TC_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE tc_get_lines OUTPUT.
g_tc_lines = sy-loopc.
IF tc-current_line = 3.
LOOP AT SCREEN.
IF screen-group1 = 'TCFL'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. "TC_GET_LINES OUTPUT
Here screen group 'TCFL' has to be set for all the table control fields.Her i have set the 3rd row as display only.
Message was edited by:
Vigneswaran S
06-07-2007 12:14 PM
hi..
It is possible to make some rows to editable and some rows to display only.Refer to the demo program <b>demo_dynpro_tabcont_loop_at</b> for changing properties of screen fields. You can change the fields using a condition like "if sy-tabix gt 5." to modify fields from 6th row.
regards,
veeresh
06-07-2007 12:41 PM
Hi,
Yes, u can make some rows uneditable. Assume you have 5 rows and you can make the 6th row editable for the user and the 5 rows to be noneditable.Refer to the code below. the logic followed is: when u display some records u can append an empty record to your internal table from which u will be populating the table control and in the PBO u can loop at the tbale control and modify the screen. Refer to the code below.
DATA:col TYPE cxtab_column.
MODULE user_command_9000 INPUT.
CASE ok-code.
WHEN 'DISP'.
SELECT mandt
empid
depno
empname
eaddress
INTO TABLE gt_mod
FROM ztrch_module.
CLEAR GT_MOD.
APPEND GT_MOD.
ENDMODULE. " USER_COMMAND_9000 INPUT
MODULE status_9000 OUTPUT.
SET PF-STATUS 'TEST'.
SET TITLEBAR 'TITLE'.
DESCRIBE TABLE gt_mod LINES SY-TFILL.
TABL_CTRL-LINES = SY-TFILL.
IF OK-CODE = 'DISPLAY'.
LOOP AT TABL_CTRL-COLS INTO COL.
LOOP AT GT_MOD.
COL-SCREEN-INPUT = '0'.
IF GT_MOD-EMPID = ' '.
COL-SCREEN-INPUT = '1'.
ENDIF.
MODIFY TABL_CTRL-COLS FROM COL.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDMODULE. " STATUS_9000 OUTPUT
Reward points if it was useful.
Regards,
Hema.