<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Wizard generated table control: bug in insert line function? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wizard-generated-table-control-bug-in-insert-line-function/m-p/3922523#M939705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a table control to a dynpro using the wizard in the screen painter. Now I have an issue with the inserting line button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I add a new line the first time, a new empty line is added to the table control before my last line. So far so good.&lt;/P&gt;&lt;P&gt;If I add now another line, again a new line empty is added before my last line and two lines are added after my last line: one empty line and a line with the same content as my former second last line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following should explain it a bit better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table before inserting new line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after inserting a new line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;new empty line&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table before inserting the second line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;line 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after inserting the second line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;new empty line&lt;/P&gt;&lt;P&gt;line 6&lt;/P&gt;&lt;P&gt;new empty line &lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't change the generated coding yet!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fischerman on May 29, 2008 9:08 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 May 2008 14:55:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-28T14:55:11Z</dc:date>
    <item>
      <title>Wizard generated table control: bug in insert line function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wizard-generated-table-control-bug-in-insert-line-function/m-p/3922523#M939705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a table control to a dynpro using the wizard in the screen painter. Now I have an issue with the inserting line button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I add a new line the first time, a new empty line is added to the table control before my last line. So far so good.&lt;/P&gt;&lt;P&gt;If I add now another line, again a new line empty is added before my last line and two lines are added after my last line: one empty line and a line with the same content as my former second last line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following should explain it a bit better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table before inserting new line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after inserting a new line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;new empty line&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table before inserting the second line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;line 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after inserting the second line:&lt;/P&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;P&gt;line 4&lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;new empty line&lt;/P&gt;&lt;P&gt;line 6&lt;/P&gt;&lt;P&gt;new empty line &lt;/P&gt;&lt;P&gt;line 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't change the generated coding yet!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fischerman on May 29, 2008 9:08 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 14:55:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wizard-generated-table-control-bug-in-insert-line-function/m-p/3922523#M939705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T14:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Wizard generated table control: bug in insert line function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wizard-generated-table-control-bug-in-insert-line-function/m-p/3922524#M939706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the code of the form which is called in PAI if the insert button was pressed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM fcode_insert_row
               USING    p_tc_name           TYPE dynfnam
                        p_table_name             .

*&amp;amp;SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
   DATA l_lines_name       LIKE feld-name.
   DATA l_selline          LIKE sy-stepl.
   DATA l_lastline         TYPE i.
   DATA l_line             TYPE i.
   DATA l_table_name       LIKE feld-name.
   FIELD-SYMBOLS &amp;lt;tc&amp;gt;                 TYPE cxtab_control.
   FIELD-SYMBOLS &amp;lt;table&amp;gt;              TYPE STANDARD TABLE.
   FIELD-SYMBOLS &amp;lt;lines&amp;gt;              TYPE i.
*&amp;amp;SPWIZARD: END OF LOCAL DATA------------------------------------------*

   ASSIGN (p_tc_name) TO &amp;lt;tc&amp;gt;.

*&amp;amp;SPWIZARD: get the table, which belongs to the tc                     *
   CONCATENATE p_table_name '[]' INTO l_table_name. "table body
   ASSIGN (l_table_name) TO &amp;lt;table&amp;gt;.                "not headerline

*&amp;amp;SPWIZARD: get looplines of TableControl                              *
   CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
   ASSIGN (l_lines_name) TO &amp;lt;lines&amp;gt;.

*&amp;amp;SPWIZARD: get current line                                           *
   GET CURSOR LINE l_selline.
   IF sy-subrc &amp;lt;&amp;gt; 0.                   " append line to table
     l_selline = &amp;lt;tc&amp;gt;-lines + 1.
*&amp;amp;SPWIZARD: set top line                                               *
     IF l_selline &amp;gt; &amp;lt;lines&amp;gt;.
       &amp;lt;tc&amp;gt;-top_line = l_selline - &amp;lt;lines&amp;gt; + 1 .
     ELSE.
       &amp;lt;tc&amp;gt;-top_line = 1.
     ENDIF.
   ELSE.                               " insert line into table
     l_selline = &amp;lt;tc&amp;gt;-top_line + l_selline - 1.
     l_lastline = &amp;lt;tc&amp;gt;-top_line + &amp;lt;lines&amp;gt; - 1.
   ENDIF.
*&amp;amp;SPWIZARD: set new cursor line                                        *
   l_line = l_selline - &amp;lt;tc&amp;gt;-top_line + 1.

*&amp;amp;SPWIZARD: insert initial line                                        *
   INSERT INITIAL LINE INTO &amp;lt;table&amp;gt; INDEX l_selline.
   &amp;lt;tc&amp;gt;-lines = &amp;lt;tc&amp;gt;-lines + 1.
*&amp;amp;SPWIZARD: set cursor                                                 *
   SET CURSOR LINE l_line.

 ENDFORM.                              " FCODE_INSERT_ROW&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2008 08:09:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wizard-generated-table-control-bug-in-insert-line-function/m-p/3922524#M939706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-29T08:09:33Z</dc:date>
    </item>
  </channel>
</rss>

