‎2011 Mar 01 2:00 AM
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.
‎2011 Mar 01 2:08 AM
Hi.
Please add the blank line to an internal table, and make it to three lines.
‎2011 Mar 01 2:08 AM
Hi.
Please add the blank line to an internal table, and make it to three lines.
‎2011 Mar 01 2:23 AM
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
‎2011 Mar 01 3:51 AM
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.
‎2011 Mar 01 4:27 AM
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
.
‎2011 Mar 01 4:41 AM
Are you displaying an internal table in the table control?
What program are you writing?
‎2011 Mar 01 4:46 AM
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.
‎2011 Mar 01 4:47 AM
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
‎2011 Mar 01 5:03 AM
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.
‎2011 Mar 01 6:34 AM
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
‎2011 Mar 10 5:52 AM
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.