<?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 STOP LOOPING_table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850541#M925686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;iam having following sytax....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my pai module...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-filed1.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field2.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field3.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-SELKZ Module  ON_SELECT on request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endchain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MODULE LOAN_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....so in above coding... ithink you can under stand that SELKZ is for to selct the table control row.... so if you selct the table control row then it will go into the module followed by...SELKZ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here now iam modifiying above coding like this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-filed1.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field2.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field3.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-SELKZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endchain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;Module  ON_SELECT on request.&lt;/P&gt;&lt;P&gt;  MODULE LOAN_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......it was also properly working but....the thing is...&lt;/P&gt;&lt;P&gt;in first coding the loop is partially running before gointo this module....but in second part the loop is completing....so because if this  iam facing trouble inthe caluculation part which is in that module and linked with the entries of the field1 and filed2....&lt;/P&gt;&lt;P&gt;so now my quetio is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     i want to stop that... &lt;/P&gt;&lt;P&gt;      loop in second..... one when one perticuler value is met.....but if i write if condition,...it was showing error like...if is not defined....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please answer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Naveen.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 06:08:25 GMT</pubDate>
    <dc:creator>naveen_inuganti2</dc:creator>
    <dc:date>2008-05-16T06:08:25Z</dc:date>
    <item>
      <title>STOP LOOPING_table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850541#M925686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;iam having following sytax....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my pai module...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-filed1.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field2.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field3.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-SELKZ Module  ON_SELECT on request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endchain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MODULE LOAN_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....so in above coding... ithink you can under stand that SELKZ is for to selct the table control row.... so if you selct the table control row then it will go into the module followed by...SELKZ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here now iam modifiying above coding like this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-filed1.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field2.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-field3.&lt;/P&gt;&lt;P&gt;      FIELD ITAB-SELKZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endchain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;Module  ON_SELECT on request.&lt;/P&gt;&lt;P&gt;  MODULE LOAN_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......it was also properly working but....the thing is...&lt;/P&gt;&lt;P&gt;in first coding the loop is partially running before gointo this module....but in second part the loop is completing....so because if this  iam facing trouble inthe caluculation part which is in that module and linked with the entries of the field1 and filed2....&lt;/P&gt;&lt;P&gt;so now my quetio is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     i want to stop that... &lt;/P&gt;&lt;P&gt;      loop in second..... one when one perticuler value is met.....but if i write if condition,...it was showing error like...if is not defined....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please answer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Naveen.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 06:08:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850541#M925686</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2008-05-16T06:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: STOP LOOPING_table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850542#M925687</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;we can't stop loop without giving error message.so erroe msg only will stop loop in PAI event. my succession is , do some validation outside the loop like itab one row to another row  comparetion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 08:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850542#M925687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T08:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: STOP LOOPING_table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850543#M925688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you need type of syntax for the select row &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  loop at IT_WK.
    chain.
      field WK_REC-SPNUM.
    endchain.
    field WK_REC-SEL "&amp;lt;== This is the selecti field that was added to the table
      module TBLCLT_MAIN_mark on request.
  endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 12:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850543#M925688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T12:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: STOP LOOPING_table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850544#M925689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may need to read up a little on the "on request" functionality... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically the logic you first had was saying&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop around my table control
" inside loop
  if the value in field SELKZ is changed (i.e. selected / deselected) 
    then run module ON_SELECT
  endif
endloop
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but you have changed it to say&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop around my table control
endloop
" after loop
if the value in field SELKZ is changed (i.e. selected / deselected) then run module ON_SELECT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I understand your requirement correctly, then what you might want to do is something like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITAB.
CHAIN.
  FIELD ITAB-filed1.
  FIELD ITAB-field2.
  FIELD ITAB-field3.
  FIELD ITAB-SELKZ Module ON_SELECT on request. "do logic in ON_SELECT
endchain.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then inside your ON_SELECT module you need to flag that you've done the work required&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
module on_select input.
" Flag we've been here this loop
break-point.  "so you can bebug your code - i.e. check you reach here
  if itab-SELKZ is initial.  "row was un-selected
    g_marked = space.
    clear: g_result.
  endif.
  if g_marked = 'X'. "already marked - so exit as we don't process any lines after the first one selected
    exit. "leave the module so no calc done on this loop
  endif.
  g_marked = 'X'.   "remember to clear this global in the PBO
  g_result = itab-field1 * itab-field2.  "or whatever your calc is
endmodule
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will mean you are able to tell in the loan_user_command whether any line was selected (from g_marked being "X"), and g_result can hold the answer to the calculation on the selected row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 06:19:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/stop-looping-table-control/m-p/3850544#M925689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T06:19:54Z</dc:date>
    </item>
  </channel>
</rss>

