<?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: Need help with a SELECT statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353765#M1036686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2
WHERE PERNR = ITAB_DATA-STAFF_NO.

Does this mean that the single data from the STAT2 field is selected and then placed back into the same field (doesn't quite makes sense, right)?&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it sense very much right.&lt;/P&gt;&lt;P&gt;have you heared about table buffer concept?&lt;/P&gt;&lt;P&gt;here this concept exactly comes.&lt;/P&gt;&lt;P&gt;try with this below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES:pa0000."tables must be decleare
SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2.
  write:PA0000-STAT2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and since you are using select single than you should be use much key as much possible for getting accurate data.other wise system will pick first data which match your where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Aug 2008 07:27:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-28T07:27:54Z</dc:date>
    <item>
      <title>Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353755#M1036676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forumers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a newbie in ABAP and I'm trying to figure out what the following line means (in &lt;STRONG&gt;bold&lt;/STRONG&gt; letters):-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;WHERE PERNR = ITAB_DATA-STAFF_NO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this mean that the single data from the STAT2 field is selected and then placed back into the same field (doesn't quite makes sense, right)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help and many thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:15:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353755#M1036676</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2008-08-28T07:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353756#M1036677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deborah Tan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2
WHERE PERNR = ITAB_DATA-STAFF_NO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it nothing but selecting single STAT2 value from the database and storing in field PA0000-STAT2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please place the cursor on the SELECT statement and press F1 then you get the required help regarding the SELECT statement and the syntax also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:19:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353756#M1036677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353757#M1036678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes..it means that a single data record is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it does not mean that it is placed back in the same table field....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you delcare PA0000 in your program, it is a local work area (memory area) which has the same structure as the table PA0000.&lt;/P&gt;&lt;P&gt;So the INTO PA0000-STAT2 means that the data from the database table are placed in the local work area in the program which has the same name as the database table. if you see the program carefully, PA0000 must have been declared like a work area of the table PA0000 in the dictionary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353757#M1036678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353758#M1036679</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;/P&gt;&lt;P&gt;Here in this Select statement - &lt;/P&gt;&lt;P&gt;A single value is reterived from the table but placed in PA0000-STAT2&lt;/P&gt;&lt;P&gt;which I think might be a parameter in the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;award points if helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353758#M1036679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353759#M1036680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here PA0000-STAT2 is your destinition work area to store data from infotype PA0000. PA0000 stores employee master data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using SELECT SINGLE you are instructing the sytem to store the first available value of STAT2 data into PA0000-STAT2 which satisfies your where condition.&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;anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:20:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353759#M1036680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353760#M1036681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deborah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PA0000 in PA0000-STAT2 might be the work area and you are sleecting into work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:21:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353760#M1036681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353761#M1036682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your understanding is correct it doesnot make any sense because your are putting a select on PA0000-stat2 which is a data base table and in INTO your are using the same table . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cnt update like this you need to declare a variable lets say stat of type pa000-stat2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in INTO clause pass the variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALSO for HR please go ahead with logical databases .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing more as u r new forumer . Please close yout question once your problem is solved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~hitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353761#M1036682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353762#M1036683</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;If you look at the syntax we are extracting STAT2 from PA0000 which is a table and we are placing it in PA0000-STAT2. &lt;/P&gt;&lt;P&gt;PA0000 is also a header line structure for the table PA0000.&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;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353762#M1036683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353763#M1036684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deborah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  As also said by others it will retrieve single data from PA0000 &lt;/P&gt;&lt;P&gt;and place it to PA0000-STAT2. Generally we do this for the selection screen validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:23:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353763#M1036684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353764#M1036685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi deborah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name in the INTO clause &lt;STRONG&gt;PA0000-STAT2&lt;/STRONG&gt; is a Workarea....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you will get a single matching &lt;STRONG&gt;STAT2&lt;/STRONG&gt; value satisfying your condition in &lt;STRONG&gt;PA0000-STAT2&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are clear now...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:24:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353764#M1036685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353765#M1036686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2
WHERE PERNR = ITAB_DATA-STAFF_NO.

Does this mean that the single data from the STAT2 field is selected and then placed back into the same field (doesn't quite makes sense, right)?&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it sense very much right.&lt;/P&gt;&lt;P&gt;have you heared about table buffer concept?&lt;/P&gt;&lt;P&gt;here this concept exactly comes.&lt;/P&gt;&lt;P&gt;try with this below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES:pa0000."tables must be decleare
SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2.
  write:PA0000-STAT2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and since you are using select single than you should be use much key as much possible for getting accurate data.other wise system will pick first data which match your where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353765#M1036686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353766#M1036687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well thats actually one of the reasons why declaring itabs with headerline is obsolete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Newbies cant read such a cryptic code and you proved it &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353766#M1036687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T07:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353767#M1036688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much for the helpful answers. It's clear enough already right now. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 07:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-a-select-statement/m-p/4353767#M1036688</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2008-08-28T07:51:00Z</dc:date>
    </item>
  </channel>
</rss>

