<?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- end select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957942#M1602513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot florian solved the issue...:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 13:48:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-07T13:48:29Z</dc:date>
    <item>
      <title>select- end select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957940#M1602511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;cc---company code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if cc is populated in selection screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SELECT a&lt;SUB&gt;bukrs a&lt;/SUB&gt;werks a&lt;SUB&gt;aufnr a&lt;/SUB&gt;gamng a&lt;SUB&gt;gstrs a&lt;/SUB&gt;gltrs a&lt;SUB&gt;rueck a&lt;/SUB&gt;autyp&lt;/P&gt;&lt;P&gt;            a&lt;SUB&gt;auart a&lt;/SUB&gt;objnr a~gmein&lt;/P&gt;&lt;P&gt;                            INTO (int_caufv-bukrs, int_caufv-werks,&lt;/P&gt;&lt;P&gt;                                  int_caufv-aufnr, int_caufv-gamng,&lt;/P&gt;&lt;P&gt;                                  int_caufv-gstrs, int_caufv-gltrs,&lt;/P&gt;&lt;P&gt;                                  int_caufv-rueck, int_caufv-autyp,&lt;/P&gt;&lt;P&gt;                                  int_caufv-auart, int_caufv-objnr,&lt;/P&gt;&lt;P&gt;                                  int_caufv-gmein)&lt;/P&gt;&lt;P&gt;                            FROM  caufv AS a INNER JOIN afvv AS b&lt;/P&gt;&lt;P&gt;                                  ON a&lt;SUB&gt;aufpl = b&lt;/SUB&gt;aufpl&lt;/P&gt;&lt;P&gt;                     WHERE a~auart IN pordtype AND         "Prod Order Type&lt;/P&gt;&lt;P&gt;                               a~bukrs = cc AND                    "Company&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                        a~aufnr IN pordno AND              "Prod order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                           b~sssbd BETWEEN tgtfm and tgtto and "Date filter&lt;/P&gt;&lt;P&gt;                                 A~WERKS in PLANT.  &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;if user does not enter company code(cc) in selection screen then i need ot fetch company code based on plant data from t001k table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have multiple company code values in internal tabel for a given range of plant data .&lt;/P&gt;&lt;P&gt;        DATA:    wa_bukrs type RANGE OF t001k-bukrs,&lt;/P&gt;&lt;P&gt;                 wa_bukrs_line like LINE OF wa_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs from t001k into table it_cust  where bwkey in plant.&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          sort it_cust by bukrs.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        loop at it_cust INTO wa_cust.&lt;/P&gt;&lt;P&gt;          wa_bukrs_line-sign   = 'I'.&lt;/P&gt;&lt;P&gt;          wa_bukrs_line-option = 'BT'.&lt;/P&gt;&lt;P&gt;          at FIRST.&lt;/P&gt;&lt;P&gt;            wa_bukrs_line-low    = wa_cust-bukrs.&lt;/P&gt;&lt;P&gt;            ENDAT.&lt;/P&gt;&lt;P&gt;            at LAST.&lt;/P&gt;&lt;P&gt;              wa_bukrs_line-high   = wa_cust-bukrs.&lt;/P&gt;&lt;P&gt;        APPEND wa_bukrs_line TO wa_bukrs.&lt;/P&gt;&lt;P&gt;        ENDAT.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;SELECT a&lt;SUB&gt;bukrs a&lt;/SUB&gt;werks a&lt;SUB&gt;aufnr a&lt;/SUB&gt;gamng a&lt;SUB&gt;gstrs a&lt;/SUB&gt;gltrs a&lt;SUB&gt;rueck a&lt;/SUB&gt;autyp&lt;/P&gt;&lt;P&gt;                   a&lt;SUB&gt;auart a&lt;/SUB&gt;objnr a~gmein&lt;/P&gt;&lt;P&gt;                                   INTO (int_caufv-bukrs, int_caufv-werks,&lt;/P&gt;&lt;P&gt;                                         int_caufv-aufnr, int_caufv-gamng,&lt;/P&gt;&lt;P&gt;                                         int_caufv-gstrs, int_caufv-gltrs,&lt;/P&gt;&lt;P&gt;                                         int_caufv-rueck, int_caufv-autyp,&lt;/P&gt;&lt;P&gt;                                         int_caufv-auart, int_caufv-objnr,&lt;/P&gt;&lt;P&gt;                                         int_caufv-gmein)&lt;/P&gt;&lt;P&gt;                                   FROM  caufv AS a INNER JOIN afvv AS b&lt;/P&gt;&lt;P&gt;                                         ON a&lt;SUB&gt;aufpl = b&lt;/SUB&gt;aufpl&lt;/P&gt;&lt;P&gt;                            WHERE a~auart IN pordtype AND         "Prod Order Type&lt;/P&gt;&lt;P&gt;                                      a~bukrs in wa_bukrs AND                    "Company&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                        a~aufnr IN pordno AND              "Prod order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                                  b~sssbd BETWEEN tgtfm and tgtto and "Date filter&lt;/P&gt;&lt;P&gt;                                        A~WERKS in PLANT.                   "Plant&lt;/P&gt;&lt;P&gt;            ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in this case sy-subrc is becoming 4 , any suggestion please......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 13:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957940#M1602511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T13:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: select- end select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957941#M1602512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check your range table wa_bukrs. I suppose it to be full of starts and nothing else.&lt;/P&gt;&lt;P&gt;check your values of wa_cust-bukrs in your AT statements during the loop.&lt;/P&gt;&lt;P&gt;To avoid this, either have a second structure taking those values during the loop, or work with a field symbol and LOOP at XXX assigning &amp;lt;YYY&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW when you are at it, rename it please for better maintainability. Every programmer would expect a workarea (structure) when variable starts with WA_.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 13:36:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957941#M1602512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T13:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: select- end select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957942#M1602513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot florian solved the issue...:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 13:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-end-select/m-p/7957942#M1602513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T13:48:29Z</dc:date>
    </item>
  </channel>
</rss>

