<?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: Comparing screen input in program in module pool programming(table control) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986095#M1605202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you want to check that in item number input field ...user should not enter same value again right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for that you can take another internal table having same structure which you have used for table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in pai, between loop and endloop. you can take all the values in some internal table itab and check when user enters value , that time it will come in tc interanl table , so you can check in itab and throw erro if repeated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2011 09:02:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-28T09:02:14Z</dc:date>
    <item>
      <title>Comparing screen input in program in module pool programming(table control)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986094#M1605201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a newbie in ABAP. I am working dialog programming where I am replicating PR creation. I am asking user to enter item number, material number and plant. I am validating material number and plant using chain and endchain. This validation is working fine and it throws error message if user enters invalid input. I am able to see corresponding details (corresponding details like unit of measure, delivery date and short text etc. if values entered are correct.) when user clicks on ADD button. Now I have one problem. If user enters same item number twice it should throw error message. I am not able to figure out how it should be done. I thought to set flag = 'X' after user enters item number. &lt;/P&gt;&lt;P&gt;I am using table control. The validation part for material number(matnr) and plant (werks) work fine. I am getting problem while checking entered item number to check duplication.&lt;/P&gt;&lt;P&gt;User should not enter the same item number again.&lt;/P&gt;&lt;P&gt;In my structure i have defined a variable called checkflag(1) type c. and i am doing it now following way. Right now my checkflag code is commented.&lt;/P&gt;&lt;P&gt;Following is my snippet for the same.&lt;/P&gt;&lt;P&gt;Please let me know your ideas/suggestions and advices. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : counter TYPE i,
         itmno1 TYPE i.

  SELECT SINGLE matnr
       FROM mara INTO matno WHERE matnr = it_pr-matnr.
  SELECT SINGLE werks
         FROM t001w INTO plant WHERE werks = it_pr-werks.
  SELECT SINGLE matnr werks
         FROM marc INTO (matno,plant)
    WHERE matnr = it_pr-matnr AND werks = it_pr-werks.
  itmno1 = it_pr-bnfpo.
  IF ok_code = 'ADD'.

    IF it_pr-matnr &amp;lt;&amp;gt; matno OR it_pr-werks &amp;lt;&amp;gt; plant AND it_pr-bnfpo = ''.
      MESSAGE 'Not a Valid material number or plant. Please enter valid values.' TYPE 'E'.

    ELSEIF it_pr-matnr = matno AND it_pr-werks = plant AND it_pr-bnfpo &amp;lt;&amp;gt; ''.

      SELECT SINGLE maktx FROM makt INTO stext WHERE matnr = it_pr-matnr.
      SELECT SINGLE meins FROM mara INTO tmeins WHERE matnr = it_pr-matnr.
      SELECT SINGLE lpein FROM eban INTO tlpein WHERE matnr = it_pr-matnr.



*      if it_pr-bnfpo = itmno1.
*        it_pr-checkflag = 'X'.
*      endif.
*
      READ TABLE it_pr WITH TABLE KEY
      checkflag = it_pr-checkflag
      bnfpo = it_pr-bnfpo
      maktx = it_pr-maktx
      matnr = it_pr-matnr
      eindt = it_pr-eindt
      meins = it_pr-meins
      werks = it_pr-werks
      lpein = it_pr-lpein.

*      if it_pr-checkflag = 'X'.
*          message 'Please enter another item number.' TYPE 'E'.
*          endif.

      IF sy-subrc &amp;lt;&amp;gt; 0.
        it_pr-bnfpo = itmno1.
        it_pr-maktx = stext.
        it_pr-lpein = tlpein.
        it_pr-meins = tmeins.
        APPEND it_pr.
      ENDIF.
      IF sy-subrc = 0.
        MESSAGE 'Please enter another item number.' TYPE 'E'.
      ENDIF.
    ENDIF.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 08:20:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986094#M1605201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-28T08:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing screen input in program in module pool programming(table control)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986095#M1605202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you want to check that in item number input field ...user should not enter same value again right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for that you can take another internal table having same structure which you have used for table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in pai, between loop and endloop. you can take all the values in some internal table itab and check when user enters value , that time it will come in tc interanl table , so you can check in itab and throw erro if repeated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 09:02:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986095#M1605202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-28T09:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing screen input in program in module pool programming(table control)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986096#M1605203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are validating the input data, there you can also validate the data that are duplicate. in the table control deep structure there is a field current_line. Check if the item number exists in any other line other than the current_line (the line you are currently processing). If it is there, then throw an error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 09:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986096#M1605203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-28T09:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing screen input in program in module pool programming(table control)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986097#M1605204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed thank you very much @medha24 and @gargi sarkar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use current-line, I will have to skip first entry as first entry should be appended. Then only I would be able to compare it with newly entered value. I will have to use loop end loop within the PAI. I have already written this code in the validation PAI  itself.&lt;/P&gt;&lt;P&gt;I am not getting how I should use loop endloop effectively so that control will go to the next iteration effectively. Right now with this code, I am getting partial success if I enter item number in bulk (more than one item number as input at same time). later, even though I enter correct values I get error message as it doesn't find next entry in the table. It only appends first records only. Therefore, I am looking to enter first entry without any check and later entries should be compared and appended. I would appreciate your ideas/suggestions.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best reagrds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 13:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-screen-input-in-program-in-module-pool-programming-table-control/m-p/7986097#M1605204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-28T13:52:44Z</dc:date>
    </item>
  </channel>
</rss>

