Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Insert lines in Table control

Former Member
0 Likes
1,793

Hi Friends,

I have set my table control fields as out put mod only,when i am selecting some records from other table control it is coming

and sit in the first table control,but as i set the fields of first table control in an output mod so empty fields are in gray mod,as

per my business logic i want to insert some lines so that i can insert some records how can i do this,i am using one

module insert_lines in PBO and under that i am using this code given below but it is not working can you help how can i proceed?

MODULE insert_lines OUTPUT.

DESCRIBE TABLE x_po1_slip LINES tabcon-lines.

IF sy-ucomm = 'INSE'.

tabcon-lines = tabcon-lines + 3.

ENDIF.

ENDMODULE.

thanks,

bikash

4 REPLIES 4
Read only

Former Member
0 Likes
1,224

Hi,

try this

INSERT INITIAL LINE INTO IT_TAB INDEX tabctrl-currentline where it_tab is the internal table for table control

then loop at screen and make the fields as editable

Edited by: Radhika Parag Rajopadhye on Jan 28, 2010 11:29 AM

Read only

0 Likes
1,224

Hi Radhika,

As per my business logic it should be in output mod only,inserting lines only for manually entering data or may be from

table control depending upon the business requirment.

thanks,

Read only

0 Likes
1,224

Hi,

If you have all the fields in the table control in the output mode, then after pressing for adding new record,

the new lines added to the table control will also be in the output mode i.e. you cannot enter any value manually there.

So you have to make these lines editable.

Read only

Former Member
0 Likes
1,224

HI,

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. "g_tc_rate_card_itab----> internal table

IF tab_fill GE 7.

calc_fill = tab_fill MOD 7. " 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

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. " tc_rate_card -


> Table control name

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