‎2012 Mar 08 8:28 PM
Hi All,
I am using table control in my program to input some data and as output it displays the same entries but the rest of the rows are grayed out.
i want it to either display input enabled blank table control with no data as output. Or it should display the entries made and the rest of the rows input enabled.
please provide help <removed by moderator>
Thanks in advance,
Chandni Sharma.
Edited by: chandnisharma89 on Mar 8, 2012 9:29 PM
Edited by: Thomas Zloch on Mar 8, 2012 10:10 PM
‎2012 Mar 09 10:10 AM
check this:
table control default no of lines are 10.
in order to enble the table control lines u need to set the lines component of structure table control say TC.
At screen Provide this logic.
process before output.
module status_001. <-- in this module set the lines of structure TC.
process after input.
loop at i_tab.
endloop.
module get_lines_in_itab.
provide the code in corresponding modules.
module status_001 output.
tc-lines = v_lines + 30. <---set the lines of table control 30 lines more than the lines in internal table
endmodule.
module get_lines_in_itab.
data v_lines type i.
clear v_lines.
describe table itab lines v_lines.
endmodule.
revert back if problem not solved!
‎2012 Mar 08 8:50 PM
I see 2 options
1) Put empty lines in your program internal table so that they will be displayed as input enabled in your table control
2) As alternative, you can use table control wizard to insert delete, add buttons for your table. In that way, if user wants to input new line, he has to click add button to add new line. Same thing to delete a line, he has to click the delete button
Dean
‎2012 Mar 09 9:03 AM
Thanks Dean.
i would do that if i do not find any other option. that would definitely solve my problem but i was looking for a standard way to do this. i cannot add add and delete row buttons since my client is not in favor of that.
‎2012 Mar 08 9:47 PM
If you want to enable an entire column you have to place something like this in the PBO module
LOOP AT SCREEN.
CASE SCREEN-FIELDNAME.
WHEN 'YOUR_FIELD_NAME'.
SCREEN-INPUT = 0.
WHEN OTHERS.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
‎2012 Mar 09 9:07 AM
Thanks fsimionatto. i think this should work but i am not able to judge how to use the case statement for my Table_control-cols-screen-name.
the name of the fields is contained in the 'name' field of structure 'screen' which is a field of 'cols' field of my table control.
‎2012 Mar 09 9:20 AM
Hi,
Try this.
LOOP AT flights-cols INTO cols. " Give your own condition
IF cols-screen-name = 'ABC'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Regards,
Danish.
‎2012 Mar 10 8:48 AM
Thanks Danish, i did try this but this does not seem to solve my problem. my table control output is still grayed out except for the rows with entries.
‎2012 Mar 09 10:10 AM
check this:
table control default no of lines are 10.
in order to enble the table control lines u need to set the lines component of structure table control say TC.
At screen Provide this logic.
process before output.
module status_001. <-- in this module set the lines of structure TC.
process after input.
loop at i_tab.
endloop.
module get_lines_in_itab.
provide the code in corresponding modules.
module status_001 output.
tc-lines = v_lines + 30. <---set the lines of table control 30 lines more than the lines in internal table
endmodule.
module get_lines_in_itab.
data v_lines type i.
clear v_lines.
describe table itab lines v_lines.
endmodule.
revert back if problem not solved!
‎2012 Mar 10 9:15 AM
Thanks watchpoint. this solved my problem. thank you so much.