<?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: Compare two fields in table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070664#M1613544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am tryng to validate a single field in a table control&lt;/P&gt;&lt;P&gt;while selecting a couple of records,i have selected say 3 with same emp id 1001 and 1 with emp id 1002&lt;/P&gt;&lt;P&gt;before saving the same, i need to pop up a error message telln tat i have selected one wrong empid 1002.&lt;/P&gt;&lt;P&gt;hope it was elaborative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Aug 2011 09:09:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-08-10T09:09:05Z</dc:date>
    <item>
      <title>Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070662#M1613542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to compare two fields in a table control with emp ids  repeating and before saving it.....have to check the selection is done with the same emp ids...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say only emp id 1001 alone is selected for saving ....?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 08:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070662#M1613542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T08:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070663#M1613543</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;&lt;/P&gt;&lt;P&gt; you requirment is not clear  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 09:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070663#M1613543</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-08-10T09:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070664#M1613544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am tryng to validate a single field in a table control&lt;/P&gt;&lt;P&gt;while selecting a couple of records,i have selected say 3 with same emp id 1001 and 1 with emp id 1002&lt;/P&gt;&lt;P&gt;before saving the same, i need to pop up a error message telln tat i have selected one wrong empid 1002.&lt;/P&gt;&lt;P&gt;hope it was elaborative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 09:09:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070664#M1613544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T09:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070665#M1613545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why cant u validate that in the qurey ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from table_1 where table_1-field1 = fk_field1&lt;/P&gt;&lt;P&gt;and table_1-field2 = fk_field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And moreover after retriving the emp id , Where do u check to confirm that u have selected the wrong emp id ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you dont want to display a message that u have selected the wrong fields , thy can be omitted y using a Query,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rep me if i am right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 09:21:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070665#M1613545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T09:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070666#M1613546</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;  best-way is in PAI write the code in save ucomm &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) append all selected records in one internal table.&lt;/P&gt;&lt;P&gt;2) read the internal table 1st record using read table index 1.&lt;/P&gt;&lt;P&gt;3) pass the emp id with one variable.&lt;/P&gt;&lt;P&gt;4) delete the selected record internal table with condition empid NE variable.&lt;/P&gt;&lt;P&gt;5) if sy-subrc = 0. throw the message because different empid is there in your internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you can understand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 09:26:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070666#M1613546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T09:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070667#M1613547</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;In Your PAI event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab BY empid.
DELETE ADJACENT DUPLICATES FROM itab COMPARING empid.
DESCRIBE TABLE itab LINES *nols* . " nols meaning no. of lines.

IF nols GT 1.
error message.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Dep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: DeepakNandikanti on Aug 10, 2011 12:18 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 10:18:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070667#M1613547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T10:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070668#M1613548</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 my previous query &lt;STRONG&gt;itab&lt;/STRONG&gt; contains selected rows from screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Dep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 10:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070668#M1613548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T10:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070669#M1613549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With Query u can delete but all the records shud be selected with tat query,not emiting those with dupolicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have selected internal table into a local temp work area&lt;/P&gt;&lt;P&gt;but selectn that will cause error everytime now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT it_tab INTO wa_tab1&lt;/P&gt;&lt;P&gt;                  WHERE sel = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if wa_tab-empid NE wa_tab1-empid.&lt;/P&gt;&lt;P&gt;    MESSAGE e000 with text-052.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 10:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070669#M1613549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070670#M1613550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey your displaying error message in loop. after the message type exit. it will exit the loop like below my code. and make sure wa_tab-empid contains old empid number..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if wa_tab-empid NE wa_tab1-empid.
MESSAGE e000 with text-052.
EXIT.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : lv_empid type empid,
       flag(1).

flag = 'X'."pass the value
LOOP AT it_tab INTO wa_tab1
WHERE sel = 'X'.
if flag = 'X'.
lv_empid = wa_tab1-empid."get the 1st empid
clear flag. "clear the flag
endif.
.
.
if lv_empid NE wa_tab1-empid.
MESSAGE e000 with text-052.
EXIT. "write EXIT here
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Dhina DMD on Aug 10, 2011 12:57 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 10:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070670#M1613550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T10:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070671#M1613551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we have smethng related to the code that i have posted without using flags?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because for wrong values the message pop-ups up but for same ids still that error message coming.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 11:35:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070671#M1613551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T11:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070672#M1613552</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; try at first event inside the loop. why i am using flag means i want to get first empid. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT it_tab INTO wa_tab1
WHERE sel = 'X'.
at first.
lv_empid = wa_tab1-empid."get the 1st empid
endat.
.
.
if lv_empid NE wa_tab1-empid.
MESSAGE e000 with text-052.
EXIT. "write EXIT here
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 11:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-fields-in-table-control/m-p/8070672#M1613552</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T11:50:22Z</dc:date>
    </item>
  </channel>
</rss>

