<?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: select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051963#M1352489</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 can segregate all these into separate fields as the length is fixed for all of them.&lt;/P&gt;&lt;P&gt;Like for division &amp;amp; D.channel you have only two characters, for sale org. you have 4 characters.&lt;/P&gt;&lt;P&gt;So declare 4 fields for these values as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data : m_division(2) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_channel(2) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_org(4) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_cust(10) type c.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;now you can segragate as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;say s_cust is having value as '0101201003600789'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;m_cust = s_cust+8(10).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;now it will pick only characters starting after 8th positions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2009 12:02:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-13T12:02:18Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051961#M1352487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Please use meaningfull subject titles in future&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------" /&gt;&lt;P&gt;Basically Iu2019m into BW but currently Iu2019ve to write a report:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iu2019ve a report in which a field CUSTOMER is defined as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables: /BIO/PCUST_SALES, /BIO/HCUST_SALES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: S_CUST for /BIO/PCUST_SALES-cust_sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select nodename datefrom dateto into table h_customer where nodename in S_CUST. can be written to fetch validity dates from /BIO/HCUST_SALES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my issue is S_CUST is normal 8 digit sold_toparty where as nodename is concatenation of division distr_chan salesorg and sol_toparty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG: S_CUST(Cust_sales) value is 03600789, where as nodename is in the format 0101201003600789 (Where the first 01 is for division, 2nd 01 for distr_chan, 2010 for salesorg n the cust_sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some please suggest how I can get the validity dates from database table /BIO/HCUST_SALES in this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Madavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Aug 13, 2009 4:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 11:53:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051961#M1352487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-13T11:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051962#M1352488</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;One way is to write the select using wild card entries like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

SELECT-OPTIONS: S_CUST for /BIO/PCUST_SALES-cust_sales.

concatenate '%' s_cust-low into s_cust-low.

Select nodename datefrom dateto 
into table h_customer 
where nodename like S_CUST-low.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 11:59:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051962#M1352488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-13T11:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051963#M1352489</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 can segregate all these into separate fields as the length is fixed for all of them.&lt;/P&gt;&lt;P&gt;Like for division &amp;amp; D.channel you have only two characters, for sale org. you have 4 characters.&lt;/P&gt;&lt;P&gt;So declare 4 fields for these values as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data : m_division(2) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_channel(2) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_org(4) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;m_cust(10) type c.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;now you can segragate as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;say s_cust is having value as '0101201003600789'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;m_cust = s_cust+8(10).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;now it will pick only characters starting after 8th positions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 12:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051963#M1352489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-13T12:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051964#M1352490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks both,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the quick turn around..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My exact requirement is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iu2019ve 2 tables /bi0/hcust_sales &amp;amp; /bi0/pcust_sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table /bi0/Pcust_sales contains fields division, distr_chan, salesorg &amp;amp; sold_to&lt;/P&gt;&lt;P&gt;Table /bi0/hcust_sales contains fields nodename, datefrom &amp;amp; dateto&lt;/P&gt;&lt;P&gt;Nodename = concatenation of division, distr_chan, salesorg &amp;amp; soldto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My aim is to move the fields from both of these tables(may be inner join concept will work out)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Division, distr_chan, sales_org, sold_to from /bi0/pcust_sales and dateto datefrom from table /bi0/hcust_sales for all the (sold_to)values entered by the user in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any now now please let me know in detail how can I achieved this, as I'm new to ABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 10:27:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051964#M1352490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-14T10:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051965#M1352491</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;U cannot use join as there was no common field in both the tables...try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty_tab,&lt;/P&gt;&lt;P&gt;            division       type  &amp;lt;give the dataelement&amp;gt;, &lt;/P&gt;&lt;P&gt;            distr_chan  type  &amp;lt;give the dataelement&amp;gt;,  &lt;/P&gt;&lt;P&gt;            salesorg     type  &amp;lt;give the dataelement&amp;gt;, &lt;/P&gt;&lt;P&gt;             sold_to       type  &amp;lt;give the dataelement&amp;gt;,&lt;/P&gt;&lt;P&gt;            nodname     like  /bi0/hcust_sales-nodname, &lt;/P&gt;&lt;P&gt;          end of ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type table of ty_tab,&lt;/P&gt;&lt;P&gt;          itab1 type table of  /bi0/hcust_sales . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select division  distr_chan  salesorg   sold_to from /bi0/Pcust_sales into corresponding field of table itab&lt;/P&gt;&lt;P&gt;where division in s_division (selection-screen field)&lt;/P&gt;&lt;P&gt;and     distr_chan in s_distr_chan &lt;/P&gt;&lt;P&gt;and      salesorg  in s_salesorg&lt;/P&gt;&lt;P&gt;and     sold_to     in s_sold_to.&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;LOOP at ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE ITAB-DIVISION   ITAB-DISTR_CHAN   ITAB-SALESORG   ITAB-SOLD_TO INTO ITAB-NODENAME.&lt;/P&gt;&lt;P&gt;MODIFY ITAB.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;now ur itab has the nodename values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not ITAB[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select nodename  datefrom  dateto from Table /bi0/hcust_sales  into table itab1&lt;/P&gt;&lt;P&gt;for all entries in ITAB&lt;/P&gt;&lt;P&gt;where Nodename = ITAB-NODENAME&lt;/P&gt;&lt;P&gt;and     datefrom    = s_date_from&lt;/P&gt;&lt;P&gt;and     dateto        = s_date_to.&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;Now ITAB1 will have the required data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 10:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051965#M1352491</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-08-14T10:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051966#M1352492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhavi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you have said that you need to fetch data form tables /bi0/hcust_sales and /bi0/pcust_sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what you can do is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. create an internal table (first_itab) with fields &lt;STRONG&gt;Division, distr_chan, sales_org, sold_to&lt;/STRONG&gt; and then fetch all these data form table /bi0/pcust_sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create second internal table (sec_itab) with fields sold_to and nodename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Put a loop on the first internal table (first itab) and then append second internal table (sec_itab) using below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT first itab.
    sec_itab-sold_to = first_itab-sold_to.

     CONCATENATE first_itab-division,
                               first_itab-distr_chan, 
                               first_itab-salesorg,
                               first_itab-soldto
                     INTO  sec_itab-nodename.
     APPEND sec_itab. 
   ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Now you have got the relevant nodename for sold_to values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Create another internal table with fields nodename, dateto and datefrom. &lt;/P&gt;&lt;P&gt;    and fetch all the data from /bi0/hcust_sales for all the entries in sec_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will sort out your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 10:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051966#M1352492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-14T10:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051967#M1352493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thanks both for your valuable suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting data from my first table is very easy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select division distr_chan salesorg cust_sales into corresponding fields of table itab1&lt;/P&gt;&lt;P&gt;    from /bi0/pcust_sales where cust_sales in s_cust.&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;LOOP at ITAB.&lt;/P&gt;&lt;P&gt;CONCATENATE ITAB-DIVISION   ITAB-DISTR_CHAN   ITAB-SALESORG   ITAB-SOLD_TO INTO ITAB-NODENAME.&lt;/P&gt;&lt;P&gt;MODIFY ITAB.&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;if not ITAB[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select nodename  datefrom  dateto from Table /bi0/hcust_sales  into table itab2&lt;/P&gt;&lt;P&gt;for all entries in ITAB1&lt;/P&gt;&lt;P&gt;where Nodename = ITAB1-NODENAME.&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;Now table Itab1 has fields division distr_chan salesorg cust_sales  and&lt;/P&gt;&lt;P&gt;Itab2 has nodename datefrom dateto and now I would like to move few fileds from these 2 tables in one more internal table as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select a&lt;SUB&gt;division a&lt;/SUB&gt;distr_chan a&lt;SUB&gt;salesorg a&lt;/SUB&gt;cust_sales&lt;/P&gt;&lt;P&gt;          B&lt;SUB&gt;datefrom B&lt;/SUB&gt;dateto into table itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct me with this third internal table itab3u2026&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 11:54:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051967#M1352493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-14T11:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051968#M1352494</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 u can use the below offset values .... in R/3 the distribution channel has 2 chars, divison 2 cahrs. sales org 4 chars,&lt;/P&gt;&lt;P&gt;customer 10 chars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at ITAB2.&lt;/P&gt;&lt;P&gt; ITAB3-DIVISION          = ITAB2+0(2).&lt;/P&gt;&lt;P&gt; ITAB3-DISTR_CHAN   = ITAB2+2(2).&lt;/P&gt;&lt;P&gt; ITAB3-SALESORG     = ITAB2+4(4). &lt;/P&gt;&lt;P&gt; ITAB3-SOLD_TO        = ITAB2+8(10).&lt;/P&gt;&lt;P&gt; ITAB3-DATEFROM     = ITAB2-DATEFROM&lt;/P&gt;&lt;P&gt; ITAB3-DATETO          = ITAB2-DATETO.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;APPEND  ITAB3.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now u will have all the values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 12:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051968#M1352494</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-08-14T12:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051969#M1352495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Write Code like this:&lt;/P&gt;&lt;P&gt;parameters: p_VTWEG type VTWEG obligatory,&lt;/P&gt;&lt;P&gt;                    p_SPART type SPART obligatory,&lt;/P&gt;&lt;P&gt;                    p_vkorg type vkorg obligatory.&lt;/P&gt;&lt;P&gt;Tables: /BIO/PCUST_SALES, /BIO/HCUST_SALES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: S_CUST for /BIO/PCUST_SALES-cust_sales obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of wa_node,&lt;/P&gt;&lt;P&gt;           nodename type nodename " use proper data element here&lt;/P&gt;&lt;P&gt;         end of wa_node,&lt;/P&gt;&lt;P&gt;         t_nodes like standard table of wa_node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if if s_cust[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;    "  write select query here first to get custmers into one internal table Ex: t_custmer, for S_CUST.&lt;/P&gt;&lt;P&gt;     refresh: t_nodes.&lt;/P&gt;&lt;P&gt;     loop at custmer into w_custmer.&lt;/P&gt;&lt;P&gt;        wa_node-nodename+0(2) = p_SPART.&lt;/P&gt;&lt;P&gt;        wa_node-nodename+2(2) = p_VTWEG.&lt;/P&gt;&lt;P&gt;        wa_node-nodename+4(4) = p_vkorg.&lt;/P&gt;&lt;P&gt;        wa_node-nodename+8      = w_custmer-cust.&lt;/P&gt;&lt;P&gt;       append wa_node to t_nodes.     &lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;     Select nodename datefrom dateto into table h_customer&lt;/P&gt;&lt;P&gt;       for all entries in t_nodes&lt;/P&gt;&lt;P&gt;          where nodename - t_nodes-nodename.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Balaji Peethani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2009 15:15:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051969#M1352495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-14T15:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051970#M1352496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagaraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I felt this is a very good option to move data from both tables ITAB1 &amp;amp; ITAB2 into ITAB3 but unfortunately Iu2019ve few more Z fields in ITAB1 which are not available in ITAB2,so in this step if I loop at ITAB2 and fetch data for all fields Iu2019m unable to fetch data for those z fieldsu2026&lt;/P&gt;&lt;P&gt;Please suggest if there is any other option to move all these fields into ITAB 3 from ITAB1 &amp;amp; Itab2.&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;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 06:05:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051970#M1352496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T06:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051971#M1352497</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;U can use Read statement for ITAB1 inside ITAB2....as u have nodename as common in both the internal tables..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 with key nodename = itab2-nodename.&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;Now move ur itab1-zfields to itab3.&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;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 06:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051971#M1352497</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-08-17T06:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051972#M1352498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks 4 all ur support,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is now resolved but time consuming so have to check vth the performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2009 06:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6051972#M1352498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-18T06:18:03Z</dc:date>
    </item>
  </channel>
</rss>

