<?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: problem in selecting a single record... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194085#M129217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to think about what you mean by a 'PO's amount'. PO headers are stored on EKKO. DO you want the sum of all amounts relating to a complete PO?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More likely you are trying to deal with line items. These are held in EKPO. EKPO has NETWR for net order value and BRTWR for gross order value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EKBE has history of each line item but there can be multiples per line item which is probably not what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2006 03:59:35 GMT</pubDate>
    <dc:creator>former_member186741</dc:creator>
    <dc:date>2006-02-23T03:59:35Z</dc:date>
    <item>
      <title>problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194078#M129210</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;&lt;/P&gt;&lt;P&gt;How can I modify my code below in selecting only one wrbtr from table ekbe? Also, what is wrbtr and how does it relate to a certain PO? is it the balance? the PO amount? Thanks guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE t_pohistory-mat_doc t_pohistory-doc_year&lt;/P&gt;&lt;P&gt;                INTO bkpf-awkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          SELECT SINGLE * FROM bkpf&lt;/P&gt;&lt;P&gt;                WHERE awkey = bkpf-awkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*AVH - removed wrbtr from selection&lt;/P&gt;&lt;P&gt;          SELECT augdt augbl shkzg dmbtr FROM bsak&lt;/P&gt;&lt;P&gt;                INTO (bsak-augdt,bsak-augbl,bsak-shkzg,&lt;/P&gt;&lt;P&gt;                      bsak-dmbtr)&lt;/P&gt;&lt;P&gt;                WHERE bukrs = bkpf-bukrs&lt;/P&gt;&lt;P&gt;                  AND gjahr = bkpf-gjahr&lt;/P&gt;&lt;P&gt;                  AND belnr = bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*AVH&lt;/P&gt;&lt;P&gt;            if not bsak-augbl is initial.&lt;/P&gt;&lt;P&gt;              select belnr gjahr from bsak&lt;/P&gt;&lt;P&gt;               into (bsak-belnr, bsak-gjahr)&lt;/P&gt;&lt;P&gt;                where bukrs = bkpf-bukrs&lt;/P&gt;&lt;P&gt;                 and belnr = bkpf-belnr&lt;/P&gt;&lt;P&gt;                 and gjahr = bkpf-gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                select awkey from bkpf&lt;/P&gt;&lt;P&gt;                 into v_bkpf_aw&lt;/P&gt;&lt;P&gt;                 where bukrs = 'GLOB'&lt;/P&gt;&lt;P&gt;                   and belnr = bsak-belnr&lt;/P&gt;&lt;P&gt;                   and gjahr = bsak-gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  w_len = strlen( v_bkpf_aw ).&lt;/P&gt;&lt;P&gt;                  w_off = w_len - 4.&lt;/P&gt;&lt;P&gt;                  v_awkey_1 = v_bkpf_aw+0(10).&lt;/P&gt;&lt;P&gt;                  v_awkey_2 = v_bkpf_aw+w_off(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  select wrbtr from ekbe&lt;/P&gt;&lt;P&gt;                    into ekbe-wrbtr&lt;/P&gt;&lt;P&gt;                   where belnr = v_awkey_1&lt;/P&gt;&lt;P&gt;                     and gjahr = v_awkey_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*AVH - Changed all bsak-wrbtr to ekbe-wrbtr.&lt;/P&gt;&lt;P&gt;                    IF bsak-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;                      bsak-dmbtr = - bsak-dmbtr.&lt;/P&gt;&lt;P&gt;                      ekbe-wrbtr = - ekbe-wrbtr.&lt;/P&gt;&lt;P&gt;                    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    IF t_pohistory-currency &amp;lt;&amp;gt; 'PHP'.&lt;/P&gt;&lt;P&gt;                      IF bsak-augdt GT pa_augdt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             IF bsak-augdt IN so_augdt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            t_amount-tramt = t_amount-tramt + ekbe-wrbtr.&lt;/P&gt;&lt;P&gt;                      ENDIF.&lt;/P&gt;&lt;P&gt;                    ELSE.&lt;/P&gt;&lt;P&gt;                      IF bsak-augdt GT pa_augdt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             IF bsak-augdt IN so_augdt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             t_amount-tramt = t_amount-tramt + bsak-dmbtr.&lt;/P&gt;&lt;P&gt;                      ENDIF.&lt;/P&gt;&lt;P&gt;                    ENDIF.&lt;/P&gt;&lt;P&gt;                  endselect.&lt;/P&gt;&lt;P&gt;                endselect.&lt;/P&gt;&lt;P&gt;              endselect.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          ENDSELECT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194078#M129210</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-02-23T03:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194079#M129211</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;PL change the SELECT form EBKE as noted below..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select wrbtr up to 1 rows
             from ekbe
             into ekbe-wrbtr 
             where belnr = v_awkey_1
             and gjahr = v_awkey_2.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRBTR is the Amount in Purchasing Document Currency. It is the Total Value of the Qunatity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:28:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194079#M129211</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-02-23T03:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194080#M129212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;b&amp;gt;single&amp;lt;/b&amp;gt; wrbtr from ekbe&lt;/P&gt;&lt;P&gt;into ekbe-wrbtr&lt;/P&gt;&lt;P&gt;where belnr = v_awkey_1&lt;/P&gt;&lt;P&gt;and gjahr = v_awkey_2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194080#M129212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T03:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194081#M129213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So how can I validate if a certain PO's amount is correct? for example, where would I go if I want to check PO 4500000006 amount? will I go to ekbe-wrbtr?or to toher tables?Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:36:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194081#M129213</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-02-23T03:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194082#M129214</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;I think you want total for a PO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write this :&lt;/P&gt;&lt;P&gt;data : ZWRBTR type EKBE-WRBTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select SUM ( wrbtr )from ekbe  into ZWRBTR           where belnr = v_awkey_1  &lt;/P&gt;&lt;P&gt;and gjahr = v_awkey_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZWRBTR   will be the total amount of a PO means sum of all line items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you are using BELNR(Number of Material Document) and year then you want only one record then I think you want total PO value. The above code will retrieve total PO value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lanka&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:46:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194082#M129214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T03:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194083#M129215</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;I think you should be using EKPO for that..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:49:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194083#M129215</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-02-23T03:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194084#M129216</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 check the amount at EKPO with PO no and line item . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means check EKPO-EBELN = EKBE-EBELN&lt;/P&gt;&lt;P&gt;        and EKPO-EBELP = EKBE-EBELP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check EKPO-NETWR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:53:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194084#M129216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T03:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194085#M129217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to think about what you mean by a 'PO's amount'. PO headers are stored on EKKO. DO you want the sum of all amounts relating to a complete PO?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More likely you are trying to deal with line items. These are held in EKPO. EKPO has NETWR for net order value and BRTWR for gross order value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EKBE has history of each line item but there can be multiples per line item which is probably not what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 03:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194085#M129217</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-02-23T03:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting a single record...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194086#M129218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to look at your logic as well. You have heavily nested selects and some of them don't use keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 14:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-a-single-record/m-p/1194086#M129218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T14:31:18Z</dc:date>
    </item>
  </channel>
</rss>

