<?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: Loop at Screen problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922176#M1148518</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;Make the changes as below in bold letters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;IF sy-tabix = 1.&lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KBETR' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;screen-input = '0'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'1'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ELSEIF screen-name = 'ITAB-KAWRT'.&lt;/P&gt;&lt;P&gt;screen-input = '1'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'0'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT ITAB BY KSCHL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_kschl WITH KEY kschl = itab-kschl &lt;STRONG&gt;BINARY SEARCH&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KAWRT' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KBETR'.&lt;/P&gt;&lt;P&gt;screen-input = '0'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'1'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ELSEIF screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;screen-input = '1'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'0'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Dec 2008 15:15:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-08T15:15:45Z</dc:date>
    <item>
      <title>Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922173#M1148515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am facing a few hicups in my code, I needed to make certain FIelds as updateable and some as non updateable but the problem is that this is not happening. Can you tell me where i am going wrong. I have written this code in my PBO at the end. The Code should enable FIELD KAWRT for the 1st Line and disable the rest, while for the others it should enable Field KWERT. what is the problem in my code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT itab.&lt;/P&gt;&lt;P&gt;    IF sy-tabix = 1.&lt;/P&gt;&lt;P&gt;      LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;        IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;           screen-name = 'ITAB-KBETR' OR&lt;/P&gt;&lt;P&gt;           screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;          screen-input = '0'.&lt;/P&gt;&lt;P&gt;          screen-output = '0'.&lt;/P&gt;&lt;P&gt;          MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;        ELSEIF screen-name = 'ITAB-KAWRT'.&lt;/P&gt;&lt;P&gt;          screen-input = '1'.&lt;/P&gt;&lt;P&gt;          screen-output = '1'.&lt;/P&gt;&lt;P&gt;          MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE i_kschl WITH KEY kschl = itab-kschl.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;        IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;           screen-name = 'ITAB-KAWRT' OR&lt;/P&gt;&lt;P&gt;           screen-name = 'ITAB-KBETR'.&lt;/P&gt;&lt;P&gt;          screen-input = '0'.&lt;/P&gt;&lt;P&gt;          screen-output = '0'.&lt;/P&gt;&lt;P&gt;          MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;        ELSEIF screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;          screen-input = '1'.&lt;/P&gt;&lt;P&gt;          screen-output = '1'.&lt;/P&gt;&lt;P&gt;          MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922173#M1148515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922174#M1148516</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;Instead of sy-tabix...change to sy-index and check...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab.
"IF sy-tabix = 1. Change here...
if sy-index = 1.
LOOP AT SCREEN.
IF screen-name = 'ITAB-KSCHL' OR
screen-name = 'ITAB-KBETR' OR
screen-name = 'ITAB-KWERT'.
screen-input = '0'.
screen-output = '0'.
MODIFY SCREEN.
ELSEIF screen-name = 'ITAB-KAWRT'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:14:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922174#M1148516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922175#M1148517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;IF sy-tabix = 1.&lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KBETR' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KWERT'. -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; &lt;STRONG&gt;remove this condition here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;screen-input = '0'.&lt;/P&gt;&lt;P&gt;screen-output = '0'.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif. --&amp;gt; &lt;STRONG&gt;otherwise close your first endif here. and start agagin if statemnet&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KAWRT'. &lt;/P&gt;&lt;P&gt;screen-input = '1'.&lt;/P&gt;&lt;P&gt;screen-output = '1'.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:15:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922175#M1148517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922176#M1148518</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;Make the changes as below in bold letters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;IF sy-tabix = 1.&lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KBETR' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;screen-input = '0'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'1'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ELSEIF screen-name = 'ITAB-KAWRT'.&lt;/P&gt;&lt;P&gt;screen-input = '1'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'0'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT ITAB BY KSCHL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_kschl WITH KEY kschl = itab-kschl &lt;STRONG&gt;BINARY SEARCH&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF screen-name = 'ITAB-KSCHL' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KAWRT' OR&lt;/P&gt;&lt;P&gt;screen-name = 'ITAB-KBETR'.&lt;/P&gt;&lt;P&gt;screen-input = '0'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'1'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ELSEIF screen-name = 'ITAB-KWERT'.&lt;/P&gt;&lt;P&gt;screen-input = '1'.&lt;/P&gt;&lt;P&gt;screen-output = &lt;STRONG&gt;'0'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922176#M1148518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922177#M1148519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well..i think there are lot of hiccups in the code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are giving the internal table field name in SCREEN-NAME..which is incorrect.. you have to give the name of the parameter or select option given in the selection screen....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922177#M1148519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922178#M1148520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using table control ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 15:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922178#M1148520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T15:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922179#M1148521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Well I am using a Table Control, the problem is that for all the records the FIELD KWERT is getting enabled, which should not happen for the 1st line that has base value FIELD KAWRT should be enabled and FIELD KWERT should be disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         KSSCHL    KAWRT       KBETR        KWERT &lt;/P&gt;&lt;P&gt;1       BASE        ENABLED    DISABLED  DISABLED&lt;/P&gt;&lt;P&gt;2       ED             DISABLED   DISABLED  ENABLED&lt;/P&gt;&lt;P&gt;3       INSU          DISABLED   DISABLED  ENABLED&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that even for the 1st LINE KAWRT is getting disabled. i.e. the second logic is overiding the 1st logic although in the debug mode it shows properly and doing the proper assignment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2008 06:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922179#M1148521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-09T06:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922180#M1148522</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;Its happening so because as in your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab.
IF sy-tabix = 1.
LOOP AT SCREEN.                             "This is executed for the First Time That's *FINE*
IF screen-name = 'ITAB-KSCHL' OR
screen-name = 'ITAB-KBETR' OR
screen-name = 'ITAB-KWERT'.
screen-input = '0'.
screen-output = '0'.
MODIFY SCREEN.
ELSEIF screen-name = 'ITAB-KAWRT'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

READ TABLE i_kschl WITH KEY kschl = itab-kschl.    
*THIS PART OF CODE IS EXECUTED ALWAYS WHICH YOU DON'T  WANT SO THIS  SHUD BE IN ELSE PART OF _*IF SY-TABIX = 1**_                                              
IF sy-subrc = 0.
LOOP AT SCREEN.
IF screen-name = 'ITAB-KSCHL' OR
screen-name = 'ITAB-KAWRT' OR
screen-name = 'ITAB-KBETR'.
screen-input = '0'.
screen-output = '0'.
MODIFY SCREEN.
ELSEIF screen-name = 'ITAB-KWERT'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DO LIKE:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab.
IF sy-tabix = 1.
LOOP AT SCREEN.                      
............................
............................
ENDLOOP.
ELSE.
READ TABLE i_kschl WITH KEY kschl = itab-kschl.    
............................
............................
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2008 07:03:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922180#M1148522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-09T07:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Screen problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922181#M1148523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well anyways the table i_kschl does not contain the 1st record i.e. the BASE Price. so it doesnt execute that code for the 1st record. anyways I did try out your sugestion but still it didnt help. it is giving default as the last record that it gets in the loop to all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yao chhang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2008 09:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-screen-problem/m-p/4922181#M1148523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-09T09:12:05Z</dc:date>
    </item>
  </channel>
</rss>

