<?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: Doubt in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402652#M1046440</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;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="168713"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Aug 2008 12:44:23 GMT</pubDate>
    <dc:creator>bpawanchand</dc:creator>
    <dc:date>2008-08-27T12:44:23Z</dc:date>
    <item>
      <title>Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402643#M1046431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;  In my requirement i want to fetch a field by giving the where codn such as &lt;/P&gt;&lt;P&gt;1)fields from different tables &lt;/P&gt;&lt;P&gt;2)using the value which i have already placed in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me how to code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402643#M1046431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402644#M1046432</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 INNER JOIN to join different tables based on the key you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:36:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402644#M1046432</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-08-27T12:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402645#M1046433</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 the INNER JOIN statement ( several table )&lt;/P&gt;&lt;P&gt;&amp;amp; the "FOR ALL ENTRIES" statement for your input internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the F1 help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:37:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402645#M1046433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402646#M1046434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have to select one record use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ itab1 with key field = itab2-field TRANSPORTING field.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have to select more than one record use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP at itab2 where field = itab1-field.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the values to be fetched are form DB use INNER JOIN or use statement  FOR ALL ENTRIES IN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:39:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402646#M1046434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402647#M1046435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the table that you want to fetch the values from and what are the other table fields that you are placing in the WHERE condition. Without knowing these it wouldnt be appropriate to give any solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:39:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402647#M1046435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402648#M1046436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cant i use like this in the where codn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where name1  = t001w-name1 and belnr = bseg-belnr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:40:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402648#M1046436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402649#M1046437</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 select the fields which u are going to pass in WHERE condition from a table.&lt;/P&gt;&lt;P&gt;Then use SELECT .. FOR ALL ENTRIES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select matnr from mara
into table it_mara
where matnr in s_matnr.

if it_mara[] is not initial.
  select matnr maktx from makt
  into table it_makt
  for all entries in it_mara
  where matnr = it_mara-matnr.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402649#M1046437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402650#M1046438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;actually i want to fetch the document number(belnr) by using the where codn from different tables like lfa1,anlav and based on the wbs elements which i have already fertched and placed in the internal table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402650#M1046438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402651#M1046439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;you can do something like that if you put BSEG &amp;amp; T001W in the join.&lt;/P&gt;&lt;P&gt;( join on .... )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the F1 help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:44:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402651#M1046439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402652#M1046440</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;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="168713"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:44:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402652#M1046440</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-08-27T12:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402653#M1046441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the reason why i asked you to elaborate your requirement. That would give us an opportunity to come up with more precise solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do one thing, Go for a select endselect. First pick up the root document, based on that within that select endselect call a perform and select the other value. Once you get the required documents, go for the last select where in you will specify the WHERE condition and fetch the data(EBELNR) from the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In one of the performs (where the selected data can be compared to that in the internal table) do a READ with KEY and you will have the required field value too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some sample code to give you a clear idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    SELECT lifnr                         " Acc. No. of Vendor
      FROM vbpa
      INTO (w_lifnr)
     WHERE vbeln EQ w_vbeln
       AND parvw EQ c_patnr_func_sp.

* To fetch the subsequent invoice for a delivery document.
      PERFORM fetch_subsequent_invoice.

    ENDSELECT.
*----------------------------------------------------------------------*
*  FORM FETCH_SUBSEQUENT_INVOICE                                       *
*----------------------------------------------------------------------*
*  Subroutine for fetching the subsequent invoice for a delivery from  *
*  VBFA                                                                *
*----------------------------------------------------------------------*
*  There are no interface parameters to be passed to this subroutine.  *
*----------------------------------------------------------------------*
FORM fetch_subsequent_invoice .

  CLEAR w_invc.

  SELECT SINGLE
         vbeln                         " Subsequent SD document
    FROM vbfa
    INTO (w_invc)
   WHERE vbelv   EQ w_vbeln
     AND vbtyp_n EQ c_doc_type_m.

  IF sy-subrc EQ 0.

* To fetch the company code based on the Invoice number.
    PERFORM fetch_company_code.

  ENDIF.                               " IF SY-SUBRC NE 0

ENDFORM.                               " FETCH_SUBSEQUENT_INVOICE
*----------------------------------------------------------------------*
*  FORM FETCH_COMPANY_CODE                                             *
*----------------------------------------------------------------------*
*  Subroutine for picking up the company code based on the subsequent  *
*  Invoice for a delivery document from VBRK                           *
*----------------------------------------------------------------------*
*  There are no interface parameters to be passed to this subroutine.  *
*----------------------------------------------------------------------*
FORM fetch_company_code .

  SELECT bukrs                         " Company Code
    FROM vbrk
    INTO (w_bukrs)
   WHERE vbeln EQ w_invc.

* To fetch the freight variance amount from the table BSIS.
    PERFORM fetch_freight_variance_amount.

  ENDSELECT.

ENDFORM.                               " FETCH_COMPANY_CODE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..........and so on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:44:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402653#M1046441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402654#M1046442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You use Inner Join for the Databse Table and use FOR ALL ENTRIES in Internal Table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Nabendu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402654#M1046442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402655#M1046443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u please tell a sample code for this.I dont know how to use join codn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:54:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402655#M1046443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402656#M1046444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;example is here&lt;/P&gt;&lt;P&gt;select kna1&lt;SUB&gt;kunnr vbak&lt;/SUB&gt;vbeln vbak&lt;SUB&gt;erdat vbak&lt;/SUB&gt;netwr into itab from kna1 inner join  vbak on kna1&lt;SUB&gt;kunnr = vbak&lt;/SUB&gt;kunnr where kna1~kunnr in &amp;lt;parameter name&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 12:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402656#M1046444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T12:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402657#M1046445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi its better to use FOR ALL ENTRIES in place of INNERJOIN.&lt;/P&gt;&lt;P&gt;When u r clubbing 2 tables(1 is DBtable and itab) in that case u want to use FOR ALL ENTRIES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 13:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402657#M1046445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T13:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402658#M1046446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it depends on the selection criteria that the user inputs and the final data that you are going to fetch. can you tell the business requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 13:03:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402658#M1046446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T13:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402659#M1046447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my requirement i want to fetch belnr based on the i/ps bukrs,anlkl,brdatu and wbs element.Already have fetched the wbs element and placed in an internal table.The other fields which i had mentioned above are in different tables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 13:10:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402659#M1046447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T13:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402660#M1046448</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>Wed, 27 Aug 2008 13:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402660#M1046448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T13:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402661#M1046449</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 this case you have to go for like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;    field1 &lt;/P&gt;&lt;P&gt;    field2&lt;/P&gt;&lt;P&gt;   end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    begin of itab2 occurs 0,&lt;/P&gt;&lt;P&gt;    field3 &lt;/P&gt;&lt;P&gt;    field4&lt;/P&gt;&lt;P&gt;   end of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; begin of itab3 occurs 0,&lt;/P&gt;&lt;P&gt;    field1&lt;/P&gt;&lt;P&gt;    field3 &lt;/P&gt;&lt;P&gt;    field5&lt;/P&gt;&lt;P&gt;   end of itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these two internal tables are not having common fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u want to select data from someother table with these two interanl tables itab1 and itab2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case use For All Entries for itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from XXXX into itab3&lt;/P&gt;&lt;P&gt;                 For All Entries in itab1&lt;/P&gt;&lt;P&gt;                 where field1 = itab1-field1.&lt;/P&gt;&lt;P&gt;here dont check itab2 values or fields.&lt;/P&gt;&lt;P&gt;then put loop for itab3 and read itab2 with key field3 = w_itab3-field3. if sy-subrc &amp;lt;&amp;gt; 0 then delete the corresponding record from itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab3 into w_itab3.&lt;/P&gt;&lt;P&gt;read table itab2 with key field3 = w_itab3-field3.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;delete corresponding record from table itab3.&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;after this you will get the record in itab3 with corresponding to tables itab1 and itab2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 19:11:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402661#M1046449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T19:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402662#M1046450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best thing to do first would be to learn how to write SQL from the beginning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good place to start is [W3 Schools|http://www.w3schools.com/sql/default.asp].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They have good tutorials where you can learn how to JOIN and do other simple things that you should probably know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 22:44:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-select-query/m-p/4402662#M1046450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T22:44:08Z</dc:date>
    </item>
  </channel>
</rss>

