‎2010 Jan 11 11:46 AM
Hi all,
I had a issue where in when I display some records in the table control, it is showing the records and the rest of the records are going into grey mode.
For example, Iam getting 3 records into the table control. From the fourth line of the table control, it is displaying the grey color.( I mean disable mode).
I have a requirement where the end user must have the facility to enter the records manually also.
So, How to make the grids of the table control in such a way we can enter some data manually along with the imported data.
Please let me get some ideas.
thanks and regards
Murali Krishna Tatoju
‎2010 Jan 11 11:58 AM
Hi Murali,
In PBO.
module status_100.
loop at itab with control tc.
endlooop.
in program
module status_100.
describe table itab lines tc-lines. " This shows number of lines occupied on Table control
if tc-lines = 0.
tc-lines = 100. " intially 100 rows
else.
tc-lines = tc-lines + 100. " Occupied rows + 100 so user can always enter
endif.
endmodule.Cheerz
Ram
‎2010 Jan 11 12:02 PM
Hi Ram,
What if there is a least chance to enter more than 200 rows, so i think its better not to set it.
or add a new entry to the internal table using a fucntion instead of displaying all the rows in editable mode
( here we can go for t_ctrl-lines).
‎2010 Jan 12 5:48 AM
Hi Ram,
Iam placing one push button (InsertLines) and when the enduser clicks, it should add 3 lines. Just like Keshav's idea, It will be more user freindly. when ever user wants to enter manually he/she can click on the push button and it will add lines for manual entry.
But for push button, do we need to write code in pai user command?
Initially, I have tried with the describe statement and added 100 lines ( as you suggested me). But iam not getting the lines in the table control.
Please give me suggestions in this regard.
thanks
Murali Krishna T
‎2010 Jan 12 5:56 AM
Hi,
Try this
ADD pushbutton will add the lines to your table control.
So initially in the PBO, set your no of active lines in the table control to be 1.
PROCESS BEFORE OUTPUT.
LOOP AT gt_itab WITH CONTROL tabcontrol.
MODULE check_control.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT gt_itab1.
MODULE GT_ITAB_MOD.
ENDLOOP.
MODULE ADD.
MODULE CHECK_CONTROL OUTPUT
if gt_itab[] is INITIAL.
TABCONTROL-lines = 1.
endif.
ENDMODULE.
Code for the ADD button in the PAI.
MODULE ADD INPUT.
if OK_CODE eq 'ADD'.
tabcontrol-lines = tabcontrol-lines + 1.
endif.
ENDMODULE. " ADD INPUT
‎2010 Jan 11 11:59 AM
Just a guess,
dont set the property t_ctrl-lines.
Make the table control screen attributes to enable.
‎2010 Jan 11 12:48 PM
Hi,
In PBO event ......create a module ....and increase the visible line count
DESCRIBE TABLE <table control table > LINES <lines>.
add 50 to <lines>.
This wil solve your problem...
Thanks,
Shailaja Ainala.
‎2010 Jan 12 6:33 AM
Hi Murali,
I have the following logic in the PBO and it works fine,
DATA: tab_fill TYPE i,
calc_fill TYPE i,
add_fill type i,
no_lines_add type i.
CLEAR: tab_fill, calc_fill, add_fill, no_lines_add.
*check the current line number and the data filled.
DESCRIBE TABLE g_tc_rate_card_itab LINES tab_fill.{color:red} "g_tc_rate_card_itab----> internal table{color}
IF tab_fill GE 7.
calc_fill = tab_fill MOD 7. {color:red}" Initial 7 rows are available in the table for input u can change this as per you requirement or the no. of rows initially available in your screen{color}
IF calc_fill = 0.
add_fill = tab_fill / 7.
add_fill = add_fill + 1.
no_lines_add = 7 * add_fill.
tc_rate_card-lines = no_lines_add. {color; red}" tc_rate_card ----> Table control name{color}
ENDIF.
ENDIF.
By this way you can get rid of the ADD button since as soon as the 7th row is filled with data it adds up more 7 rows in the table control which are read for input.
Regards,
Abhijit G. Borakr
‎2010 Jan 12 10:21 AM
Hi abhijit,
As per my requirement, I should place a push button so that whenever enduser clicks on it, it should add three lines for manual data entry.
I have written the push button code in the pbo status.
CODE snippet:
DESCRIBE ITAB LINES TABLECONTROL-LINES.
IF SY-UCOMM = ' INSERT '.
TABLECONTROL-LINES = TABLECONTROL-LINES + 3.
ENDIF.
it is working fine and problem solved.
Thanks for all of your views.
Regards
Murali Krishna T
‎2010 Jan 12 12:16 PM
Hi,
Is your problem solved ??
If yes then please close the thread.
Regards,
Abhijit G. Borkar