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

how to code? (inputable line on table control has datas)

Former Member
0 Likes
1,042

Hi, all.

I don't know how to code that I can input on no data line by table control (that has some datas) .

I can diplay some datas on my table Control,

but I can't input data under display data line.

for example , my internal table has 2 data and It displayed on table contorol.

I can't input data on 3 line on table control.

please let me know hou to code.

Regards.

Rie.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,000

Hi.

Please add the blank line to an internal table, and make it to three lines.

10 REPLIES 10
Read only

Former Member
0 Likes
1,001

Hi.

Please add the blank line to an internal table, and make it to three lines.

Read only

0 Likes
1,000

Hi Tayori

Thank you for your repry.

Is it possible inputable fileds all line after three line?

Regards

Rie.

Edited by: Rie Nagakura on Mar 1, 2011 3:23 AM

Read only

0 Likes
1,000

It is necessary to code it.

PBO.

LOOP AT IT_DATA WITH CONTROL TC_DATA

CURSOR TC_DATA-CURRENT_LINE.

MODULE M_PBO_DATA.

ENDLOOP.

&----


*& Module M_PBO_DATA OUTPUT

&----


MODULE M_PBO_DATA OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'Dynpo-Fieldname'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

endif.

ENDLOOP.

ENDMODULE.

Read only

0 Likes
1,000

Thank you for reply, Tayori.

I tried your code, but I haven't done yet...

I need to add a blank line?

Does it add before "LOOP AT IT_DATA WITH CONTROL TC_DATA CURSOR TC_DATA-CURRENT_LINE" ?

in this case, How many lines does I add?

I'd like to all line is inputable.

I tried some pattern, I didn't...

Best Regards,

Rie

.

Read only

0 Likes
1,000

Are you displaying an internal table in the table control?

What program are you writing?

Read only

0 Likes
1,000

Hi Tayori,

my problem is that when I display table control at first time, I can't input no data line.

ONLY first time.

my code is below:

-


PBO.

MODULE ADD_BLANK_LINE_TAB1.

LOOP AT IT_ZTBL INTO WK_AREA WITH CONTROL TBL_01.

CURSOR TBL_01-CURRENT_LINE.

MODULE SET_TABLE.

ENDLOOP.

MODULE ADD_BLANK_LINE_TAB1 OUTPUT.

DO LW_LINE TIMES.

APPEND INITIAL LINE TO IT_ZTBL.

ENDDO.

ENDMODULE.

MODULE SET_TABLE OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZTBL-FIELD'.

SCREEN-INPUT = '1'.

ENDIF.

ENDLOOP.

ENDMODULE.

-


Regards,

Rie.

Read only

0 Likes
1,000

Hi,

Using the below code we can insert the row in table control.

FORM fcode_insert_row

USING p_tc_name TYPE dynfnam

p_table_name .

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA l_lines_name TYPE feld-name.

DATA l_selline TYPE sy-stepl.

DATA l_lastline TYPE i.

DATA l_line TYPE i.

DATA l_table_name TYPE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <lines> TYPE i.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get the table, which belongs to the tc *

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

*&SPWIZARD: get looplines of TableControl *

CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.

ASSIGN (l_lines_name) TO <lines>.

*&SPWIZARD: get current line *

GET CURSOR LINE l_selline.

IF sy-subrc <> 0. " append line to table

l_selline = <tc>-lines + 1.

*&SPWIZARD: set top line *

IF l_selline > <lines>.

<tc>-top_line = l_selline - <lines> + 1 .

ELSE.

<tc>-top_line = 1.

ENDIF.

ELSE. " insert line into table

l_selline = <tc>-top_line + l_selline - 1.

l_lastline = <tc>-top_line + <lines> - 1.

ENDIF.

*&SPWIZARD: set new cursor line *

l_line = l_selline - <tc>-top_line + 1.

*&SPWIZARD: insert initial line *

INSERT INITIAL LINE INTO <table> INDEX l_selline.

<tc>-lines = <tc>-lines + 1.

*&SPWIZARD: set cursor *

SET CURSOR LINE l_line.

ENDFORM. " FCODE_INSERT_ROW

thanks and regards,

muralii

Read only

0 Likes
1,000

The blank line is added when internal tables are only 0 records.

Is LW_LINE numbers except 0?

PBO.

MODULE ADD_BLANK_LINE_TAB1.

LOOP AT IT_ZTBL INTO WK_AREA WITH CONTROL TBL_01.

CURSOR TBL_01-CURRENT_LINE.

MODULE SET_TABLE.

ENDLOOP.

MODULE ADD_BLANK_LINE_TAB1 OUTPUT.

check lines( IT_ZTBL ) = 0. "Add!! <-----

DO LW_LINE TIMES. 'Check!! <-----

APPEND INITIAL LINE TO IT_ZTBL.

ENDDO.

ENDMODULE.

MODULE SET_TABLE OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZTBL-FIELD'.

SCREEN-INPUT = '1'.

ENDIF.

ENDLOOP.

ENDMODULE.

Read only

0 Likes
1,000

Hi Rie,

During the Table control wizard, can you please check whether you had selected Input/Output attributes as "Input Control" in Table Control attributes step.

Regards,

Satish Kanteti

Read only

0 Likes
1,000

Hi, all.

I mistaked one.

I forgot the code -> TBL_01-LINES = LINES( IT_ZTBL ).

so I code above, I can do it.

Thank you for your comment.

I'll give you some points.

Regards.

Rie.