<?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 into variable and itab/working area together in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842601#M357914</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cannot have two into clauses.&lt;/P&gt;&lt;P&gt;use the logic as suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2007 13:39:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-29T13:39:28Z</dc:date>
    <item>
      <title>select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842597#M357910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;may i know if can select into variable and itab or into variable and working area in the same select statement?&lt;/P&gt;&lt;P&gt;if cannot then what should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x y into ( l_x , l_y ) a b c into corresponding field of table itab .......&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;select x y into ( l_x , l_y ) a b c into correspondinf field of working area .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 12:37:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842597#M357910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T12:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842598#M357911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think into is valid for one area , Two 'INTO'S  cannot be simultaneously accessed in a select .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion this is not possible .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 12:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842598#M357911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842599#M357912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x y into (l_x, l_y ).&lt;/P&gt;&lt;P&gt;wa-x = l_x.&lt;/P&gt;&lt;P&gt;wa-y = l_y.&lt;/P&gt;&lt;P&gt;append wa to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x y into wa.&lt;/P&gt;&lt;P&gt;l_x = wa-x.&lt;/P&gt;&lt;P&gt;l_y = wa-y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Florian Kemmer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:03:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842599#M357912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842600#M357913</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;select x y &amp;lt;b&amp;gt;into &amp;lt;/b&amp;gt;( l_x , l_y ) a b c &amp;lt;b&amp;gt;into&amp;lt;/b&amp;gt; corresponding field of table itab .......&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;select x y &amp;lt;b&amp;gt;into&amp;lt;/b&amp;gt; ( l_x , l_y ) a b c &amp;lt;b&amp;gt;into &amp;lt;/b&amp;gt;correspondinf field of working area .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to use into twice in select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The different possibilities are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Report zex33.
tables : likp.

select-options : s_vbeln for likp-vbeln.
data : begin of itab occurs 0,
       vbeln like likp-vbeln,
       vstel like likp-vstel,
       end of itab.

data : v_vbeln like likp-vbeln,
       v_vstel like likp-vstel.

data : wa_itab like itab.

****Method 1**************
select vbeln vstel into (v_vbeln , v_vstel)
   from likp
   where vbeln in s_vbeln.
itab-vbeln = v_vbeln.
itab-vstel = v_vstel.
append itab.
clear itab.
endselect.
******************************
********Method 2***********
*select vbeln vstel into wa_itab
*   from likp
*   where vbeln in s_vbeln.
*insert wa_itab into table itab.
*endselect.
**********************************
**********Method 3*************
*select vbeln vstel into table itab
*   from likp
*   where vbeln in s_vbeln.
*********************************
loop at itab.
   write : / itab-vbeln , itab-vstel.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842600#M357913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842601#M357914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cannot have two into clauses.&lt;/P&gt;&lt;P&gt;use the logic as suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842601#M357914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842602#M357915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just for the memory:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ABAP you as well can NO`T do following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: &lt;/P&gt;&lt;P&gt;a type c,&lt;/P&gt;&lt;P&gt;b type c,&lt;/P&gt;&lt;P&gt;c type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = b = c.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842602#M357915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842603#M357916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE VBELN ERNAM ERDAT VSTEL
  INTO (I_TAB-VBELN, I_TAB-ERNAM, V_ERDAT, V_VSTEL)
  FROM LIKP
 WHERE VBELN = V_VBELN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:56:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842603#M357916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: select into variable and itab/working area together</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842604#M357917</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 not have two INTO in one SELECT clause. In your case, along with a variable, use fields of work area &amp;amp; then append the work area to an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_vbap TYPE TABLE OF vbap.&lt;/P&gt;&lt;P&gt;DATA : x_vbap  TYPE vbap.&lt;/P&gt;&lt;P&gt;DATA : v_vbeln TYPE vbeln.&lt;/P&gt;&lt;P&gt;DATA : v_mandt TYPE mandt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT mandt vbeln posnr matnr&lt;/P&gt;&lt;P&gt;FROM vbap&lt;/P&gt;&lt;P&gt;INTO (v_mandt, v_vbeln, x_vbap-posnr, x_vbap-matnr)&lt;/P&gt;&lt;P&gt;WHERE vbeln IN s_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    APPEND x_vbap TO it_vbap.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if the answer is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 13:56:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-variable-and-itab-working-area-together/m-p/1842604#M357917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T13:56:40Z</dc:date>
    </item>
  </channel>
</rss>

