‎2009 Jan 01 3:48 AM
Transaction is in change mode for Custom Development.
Requirement : Data is fetched from Database and needs to be shown in Table control with few columns as editable and few columns as non editable.Also when we press insert button a new blank row should be inserted with all its columns as editable.
Can anyone please let me know how we can do it.
Kind Regards
Sajid
‎2009 Jan 01 3:58 AM
go for table control with wizard......here u will get all functionality(insert delete etc...)
for enabling and disabling .....use loop at screen.
modify screen.
endloop.
with in the loop in PBO of flow logic...
loop at itab.
module enable_disable.
endloop.
in driver program
module enable_disable.
endmodule...
‎2009 Jan 01 3:58 AM
go for table control with wizard......here u will get all functionality(insert delete etc...)
for enabling and disabling .....use loop at screen.
modify screen.
endloop.
with in the loop in PBO of flow logic...
loop at itab.
module enable_disable.
endloop.
in driver program
module enable_disable.
endmodule...
‎2009 Jan 01 4:15 AM
The answer to my question is:
*" screen flow PBO
loop at gt_data1 into gs_data1 with control gtc_9999.
module d9999_modify_screen_tc.
endloop.
PBO module
module d9999_modify_screen_tc output.
check gs_data1-XYZ = 'demo'. "condition
loop at screen. "for current row of TC
if screen-name = 'XYZ'. "for one cell
screen-active = '0'.
screen-intensified = '1'. "or whatever
endif.
modify screen.
endloop.
endmodule.
‎2009 Jan 01 4:16 AM
Hi Sajid,
To make certain fields as editable and some as non-editable, you can follow any one of the below two approaches:-
1. Either while designing the module pool screen keep those textbox fields as output only which need not be edited and rest textbox fields as input & output both.
2. If you want enable/disable input for textbox fields while execution, then while designing the screen, the textbox fields which need to be non-editable define the group1 as ABC for those fields. Now, In PBO of the screen, write code:-
loop at screen.
if ( screen-group1 = 'ABC' ).
screen-input = 0. "disable textbox for input
screen-active = 0.
endif.
modify screen.
endloop.
loop at screen.
if ( screen-group1 = 'ABC' ).
screen-input = 1. "enable textbox for input
screen-active = 1.
endif.
modify screen.
endloop.
The number of lines in table control depends on the size of table control on screen.
If number of lines in table control are same as the number of records in the internal table, then to insert a new row when user clicks INSERT button, then use code:-
case sy-ucomm.
when 'INSERT'.
tab_ctrl-lines = tab_ctrl-lines + 1. "to insert a new line into table control tab_ctrl
loop at screen.
if ( screen-group1 = 'ABC' ).
screen-input = 1. "enable textbox for input
screen-active = 1.
endif.
modify screen.
endloop.
endcase.
It is not possible to enable only one row when you click INSERT button, rather it will enable the all fields for all lines in table control.
We can only enable/disable columns in a table control.
So, if you want not to show the existing records when you click INSERT button then use a new table control to insert new records.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir