<?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 values in different tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875208#M1139628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK now I'm confused:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put a breakpoint as follows:&lt;/P&gt;&lt;P&gt;SELECT * FROM t527x INTO TABLE it_t527x.                         &lt;/P&gt;&lt;P&gt;LOOP AT it_ihpa INTO wa_ihpa.                                    &lt;/P&gt;&lt;P&gt;READ TABLE it_t527x INTO wa_t527x WITH KEY orgeh = wa_ihpa-parnr &lt;/P&gt;&lt;P&gt;BINARY SEARCH.                                                   &lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.                                                &lt;/P&gt;&lt;P&gt;BREAK-POINT.                                                     &lt;/P&gt;&lt;P&gt;WRITE: wa_t527X-ORGTX TO ZORGUNITTEXT.                           &lt;/P&gt;&lt;P&gt;ELSE.                                                            &lt;/P&gt;&lt;P&gt;WRITE: 'Damn it' TO ZORGUNITTEXT.                                &lt;/P&gt;&lt;P&gt;ENDIF.                                                           &lt;/P&gt;&lt;P&gt;ENDLOOP.           &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the correct values in the correct fields but still SUBRC does not = 0&lt;/P&gt;&lt;P&gt;WA_T527X-ORGTX                 Stockton - Front of House       &lt;/P&gt;&lt;P&gt;ZORGUNITTEXT                   Damn it                         &lt;/P&gt;&lt;P&gt;WA_t527X-ORGEH                 20008855                        &lt;/P&gt;&lt;P&gt;WA_IHPA-parnr                  20008855                        &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whats Wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alec Fletcher on Dec 19, 2008 1:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Dec 2008 13:48:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-19T13:48:16Z</dc:date>
    <item>
      <title>comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875182#M1139602</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 am trying to compare values in two different table fields, can someone advise me of the ABAP to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find IHPA-PARNR(partner number) in table T527X-ORGEH(org unit number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875182#M1139602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875183#M1139603</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;use command READ TABLE if you work with internal table.&lt;/P&gt;&lt;P&gt;If you work with database tables, use command SELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:22:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875183#M1139603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875184#M1139604</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;1.fetch PARNR value from table IHPA.&lt;/P&gt;&lt;P&gt;2.Fetch ORGEH value from table T527X by using &lt;STRONG&gt;All entries&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3.check sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:24:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875184#M1139604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875185#M1139605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alec,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ABAP, you can make use of LOOP and READ statements to compare the values.&lt;/P&gt;&lt;P&gt;As in this case,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I need to find IHPA-PARNR(partner number) in table T527X-ORGEH(org unit number)&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at ihpa into wa_ihpa.
Read table t527x into wa_t527x with key orgeh = wa_ihpa-parnr
                                                            binary search.
if sy-subrc eq 0.
" This means the value exists in table t527x. you can do the required modifications here.
endif.
Endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you are looking for.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:24:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875185#M1139605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875186#M1139606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Declare 1 internal table with one field PARNR,&lt;/P&gt;&lt;P&gt;     Fill that internal table with all values of table IHPA,&lt;/P&gt;&lt;P&gt;     Select the entries of table T527X into second internal table for all the values in first internal table, so the second internal table has all the vales only of the values in IHPA-PARNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use SELECT statement with FOR ALL ENTRIES addition.&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;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:29:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875186#M1139606</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2008-12-19T10:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875187#M1139607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;u can select data from IHPA by using slect &lt;/P&gt;&lt;P&gt;select PARNR  from IHPA&lt;/P&gt;&lt;P&gt;into table it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then select data from T527X&lt;/P&gt;&lt;P&gt; select ORGEH from t527X into i_tab2 &lt;/P&gt;&lt;P&gt;for all entries in it_tab where parnr = it_tab-parnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can compare using loop at it_tab and read from table i_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:31:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875187#M1139607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875188#M1139608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this as a test:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at ihpa into wa_ihpa.&lt;/P&gt;&lt;P&gt;Read table t527x into wa_t527x with key orgeh = wa_ihpa-parnr&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;WRITE 'HELLO' TO ZORGUNIT.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a syntax error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"VERSION ... ." expected after "IHPA". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what have I done wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:39:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875188#M1139608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875189#M1139609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;declare 2 internal table read all your data into these table and in loop endloop statement compare all the value you want &lt;/P&gt;&lt;P&gt;loop&lt;/P&gt;&lt;P&gt;'your if condition for comparision&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:42:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875189#M1139609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875190#M1139610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alec,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is IHPA? I mean is that an internal table. How is it declared?&lt;/P&gt;&lt;P&gt;Ideally it should have been declared as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: ihpa type standard table of ihpa,
      wa_ihpa type ihpa.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875190#M1139610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875191#M1139611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;data :it_tab like standard table of ihpa with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u can loop at it_tab instead of ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:43:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875191#M1139611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875192#M1139612</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;    Pls check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_ihpa into wa_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_t527x into wa_t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         if wa_ihpa-parnr eq wa_t527x-orgeh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;         endif.&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;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 10:45:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875192#M1139612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T10:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875193#M1139613</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;First check the data type and length of parnr and orgeh fields. And make sure that values of these two fields have same length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_ihpa like ihpa occurs 0 with header line,&lt;/P&gt;&lt;P&gt;      wa_ihpa like it_ihpa,&lt;/P&gt;&lt;P&gt;      it_t527x like t527x occurs 0 with header line,&lt;/P&gt;&lt;P&gt;      wa_t527x like it_t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select objnr parnr into corresponding fields of table it_ihpa from ihpa up to 100 rows.&lt;/P&gt;&lt;P&gt;sort it_ihpa by parnr.&lt;/P&gt;&lt;P&gt;select orgeh into corresponding fields of table it_t527x from t527x up to 100 rows.&lt;/P&gt;&lt;P&gt;sort it_t527x by orgeh.&lt;/P&gt;&lt;P&gt;loop at it_ihpa into wa_ihpa.&lt;/P&gt;&lt;P&gt;read table it_t527x into wa_t527x with key orgeh = wa_ihpa-parnr binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;write: 'successfully read'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write: 'read failed'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 11:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875193#M1139613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875194#M1139614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Don't read directly from the Table t527x, first get all the records into an internal table it_t527x and  then use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : it_ihpa TYPE  TABLE OF ihpa,&lt;/P&gt;&lt;P&gt;         wa_ihpa TYEP ihpa,&lt;/P&gt;&lt;P&gt;         it_t527x TYPE TABLE OF t527x,&lt;/P&gt;&lt;P&gt;         wa_t527x TYPE t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ihpa INTO TABLE it_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM t527x INTO TABLE it_t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ihpa INTO wa_ihpa.&lt;/P&gt;&lt;P&gt;READ TABLE it_t527x INTO wa_t527x WITH KEY orgeh = wa_ihpa-parnr&lt;/P&gt;&lt;P&gt;BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE 'HELLO' TO ZORGUNIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 11:02:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875194#M1139614</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2008-12-19T11:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875195#M1139615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Do this way:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
I need to find IHPA-PARNR(partner number) in table T527X-ORGEH(org unit number)
select parnr from IHPA into it_IHPA.

sort it_IHPA by PARNR
if not it_IHPA[] is initial.
   select ORGEH from T527X into table it_T527X
            for all entries in it_IHPA
            where  ORGEH = it_IHPA- PARNR.
endif.

now it_T527X contains the req result
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 11:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875195#M1139615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T11:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875196#M1139616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- Tried this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_ihpa like ihpa occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        it_t527x like t527x occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select parnr from IHPA into it_IHPA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_IHPA by PARNR&lt;/P&gt;&lt;P&gt;if not it_IHPA[] is initial.&lt;/P&gt;&lt;P&gt;   select ORGTX from T527X into table it_T527X&lt;/P&gt;&lt;P&gt;            for all entries in it_IHPA&lt;/P&gt;&lt;P&gt;            where  ORGEH = it_IHPA- PARNR.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: it_T527X-ORGTX to ZORGUNITTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Got syntax error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No component exists with the name "IF".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- What went wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 11:33:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875196#M1139616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T11:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875197#M1139617</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 the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF ty_ihpa,&lt;/P&gt;&lt;P&gt;         parnr TYPE ihpa-parnr,&lt;/P&gt;&lt;P&gt;        END OF ty_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_tipha TYPE TABLE OF ty_ihpa,&lt;/P&gt;&lt;P&gt;        wa_tipha TYPE ty_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_ihpa TYPE TABLE OF ihpa,&lt;/P&gt;&lt;P&gt;         wa_ihpa TYPE ihpa,&lt;/P&gt;&lt;P&gt;       it_t527x TYPE TABLE OF t527x,&lt;/P&gt;&lt;P&gt;         wa_t527x TYPE t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ihpa INTO TABLE it_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM t527x INTO TABLE it_t527x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_ihpa INTO wa_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_t527x INTO wa_t527x WITH KEY orgeh = wa_ihpa-parnr&lt;/P&gt;&lt;P&gt;  BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND wa_ihpa-parnr TO it_tipha.   "" Not able to understand what you are doing if Condition satisfied&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 12:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875197#M1139617</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2008-12-19T12:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875198#M1139618</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;you forgott point after command "sort it_IHPA by PARNR"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PA: before your WRITE command, you need to use READ TABLE  internal table it_T527X for move data to header line. If you don´t use that, ZORGUNITTEXT will be empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 12:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875198#M1139618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875199#M1139619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get round the fact that T527X-ORGEH is type NUMC 8 characters and IHPA-PARNR is CHAR 12 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently trying the following but get a syntax error because the fields are not the same type / length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_ihpa like ihpa occurs 0 with header line,&lt;/P&gt;&lt;P&gt;      it_t527x like t527x occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from IHPA into it_IHPA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_IHPA by PARNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it_IHPA is initial.&lt;/P&gt;&lt;P&gt;   select ORGTX from T527X into table it_T527X&lt;/P&gt;&lt;P&gt;            for all entries in it_IHPA&lt;/P&gt;&lt;P&gt;            where  ORGEH = it_IHPA-PARNR.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: it_t527x TO ZORGUNITEXT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 12:23:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875199#M1139619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T12:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875200#M1139620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Thats why use the sample code i have given above, fetch data from both tables and once u got the correct values clear the internal tables data which u don't require further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see above post of mine for sample code and use it.&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;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 12:27:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875200#M1139620</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2008-12-19T12:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: comparing values in different tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875201#M1139621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 12:35:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-values-in-different-tables/m-p/4875201#M1139621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T12:35:45Z</dc:date>
    </item>
  </channel>
</rss>

