<?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 Re: Looping with control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305454#M1223468</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I will try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2009 07:59:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-20T07:59:51Z</dc:date>
    <item>
      <title>Looping with control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305452#M1223466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In va02/01(uses SAPMV45A) I have created a new button which fills up profit center for all inserted rows using the first row. My problem here is that it only fills up the ones actually seen on the screen. So I debugged a little and found out that at screen 4900 it loops with control TCTRL_U_ERF_AUFTRAG. But it only loops as many times as many rows are seen on the screen. So say, I can see 9 items, but there's 30. Then it only fills up that 9 rows, because my module is inside the loop at PAI, after the button is pressed.&lt;/P&gt;&lt;P&gt;Ok, I hacked it a little bit so that the top_line would equal current_line + 1. In that way I put the same module in PBO and fill another 9 rows, which gives me a total of 18 rows (2 times the rows I can see on my screen). &lt;/P&gt;&lt;P&gt;I can fill up the fields in xvbap, which then show me the fields on screen, but they are not actually filled. &lt;/P&gt;&lt;P&gt;Soo.. at screen 4900 my code goes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP WITH CONTROL TCTRL_U_ERF_AUFTRAG.
MODULE VBAP_UNTERLEGEN.
*{   INSERT
  MODULE ZFCODE_FILL.
*}   INSERT
....
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is  MODULE ZFCODE_FILL.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  if fcode  = 'FILL' and not vbap-posnr is initial.
    data: prctr type prctr.

    read table xvbap index 1.
      prctr = xvbap-prctr.

    if vbap-prctr is initial.
      vbap-prctr = prctr.
    endif.

    LOOP AT SCREEN.
      CASE SCREEN-NAME.
        WHEN 'VBAP-PRCTR'.
          SCREEN-REQUEST = 1.
      ENDCASE.
      MODIFY SCREEN.
    ENDLOOP.
    
TCTRL_U_ERF_AUFTRAG-TOP_LINE = TCTRL_U_ERF_AUFTRAG-CURRENT_LINE + 1. (for PAI module)
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I loop TCTRL_U_ERF_AUFTRAG so that all rows are looped not only the ones actually shown on screen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305452#M1223466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-05T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305453#M1223467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Märteen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You shouldn't be able to set values that are not displayed is a table control.&lt;/P&gt;&lt;P&gt;But you should be able to set XVBAP in PAI but only after the loop at tablecontrol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to say that's kind of messy, but you already now that :).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps,&lt;/P&gt;&lt;P&gt;Edgar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 09:45:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305453#M1223467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T09:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305454#M1223468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I will try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2009 07:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305454#M1223468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-20T07:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305455#M1223469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will close this for now, and if I find a solution, I will post here as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2009 08:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-with-control/m-p/5305455#M1223469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-20T08:00:25Z</dc:date>
    </item>
  </channel>
</rss>

