<?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: Calculation from a set material with components (XVBAP/TKOMV) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-from-a-set-material-with-components-xvbap-tkomv/m-p/7615179#M1569776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Problem was, that the customer had a z-program at the end of the hole price finding process, whiche recalculate the hole thing, thats why it wasnt working. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Sep 2014 05:11:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-09-09T05:11:04Z</dc:date>
    <item>
      <title>Calculation from a set material with components (XVBAP/TKOMV)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-from-a-set-material-with-components-xvbap-tkomv/m-p/7615178#M1569775</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;&lt;/P&gt;&lt;P&gt;i have a material with components.&lt;/P&gt;&lt;P&gt;I should do a sum of the components to get the price of the material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i did this on the Conditions site in the price setting area (transaction VOFM...loop over TKOMV and write it back to TKOMV) and this is working, but the problem is in the overview of the positions, the price of the "header" material is not correct. But at the moment i double click on a position on the screen and then i go back to the overview the prive is fine. So i checked where this values are from, then i saw that this values are from the VBAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i searched a userexit and i took the USEREXIT_FIELD_MODIFICATION to change values in the XVBAP, because i saw if i change at this point a value, that this value will be on the screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now the strange thing is, that the price is not fine, but after looping over the XVBAP it looks fine. But here the strange thing are happen, i could loop over more then 20min. and im still in the loop from the userexit and modify screen area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could Somebody help my? thanks a lot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HERE the CODE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF XVBAP IS NOT INITIAL. 
 DATA: xvbap_line LIKE LINE OF XVBAP, 
       xvbap_line2 LIKE LINE OF XVBAP, 
       tmpxvbapNETWR LIKE XVBAP-NETWR, 
       tmpxvbapNETPR LIKE XVBAP-NETWR, 
       tmpxvbapKZWI1 LIKE XVBAP-KZWI1, 
       tmpxvbapKZWI2 LIKE XVBAP-KZWI2, 
       tmpxvbapKZWI3 LIKE XVBAP-KZWI3, 
       tmpxvbapKZWI4 LIKE XVBAP-KZWI4, 
       tmpxvbapKZWI5 LIKE XVBAP-KZWI5, 
       tmpxvbapKZWI6 LIKE XVBAP-KZWI6, 
       idx TYPE SY-TABIX. 
 
 LOOP AT XVBAP 
  INTO xvbap_line 
   WHERE UEPOS = '000000' 
    OR UEPOS IS INITIAL. 
 
  idx = sy-tabix. 
 
  tmpxvbapNETWR = '0.00'. 
  tmpxvbapNETPR = '0.00'. 
  tmpxvbapKZWI1 = '0.00'. 
  tmpxvbapKZWI2 = '0.00'. 
  tmpxvbapKZWI3 = '0.00'. 
  tmpxvbapKZWI4 = '0.00'. 
  tmpxvbapKZWI5 = '0.00'. 
  tmpxvbapKZWI6 = '0.00'. 
 
  LOOP AT XVBAP 
   INTO xvbap_line2 
    WHERE UEPOS = xvbap_line-POSNR. 
 
 
    tmpxvbapNETWR = tmpxvbapNETWR + xvbap_line2-NETWR. 
    tmpxvbapNETPR = tmpxvbapNETWR * 1000 / xvbap_line-KWMENG. 
 
    tmpxvbapKZWI1 = tmpxvbapKZWI1 + xvbap_line2-KZWI1. 
    tmpxvbapKZWI2 = tmpxvbapKZWI2 + xvbap_line2-KZWI2. 
    tmpxvbapKZWI3 = tmpxvbapKZWI3 + xvbap_line2-KZWI3. 
    tmpxvbapKZWI4 = tmpxvbapKZWI4 + xvbap_line2-KZWI4. 
    tmpxvbapKZWI5 = tmpxvbapKZWI5 + xvbap_line2-KZWI5. 
    tmpxvbapKZWI6 = tmpxvbapKZWI6 + xvbap_line2-KZWI6. 
 
  ENDLOOP. 
 
  xvbap_line-NETWR = tmpxvbapNETWR. 
  xvbap_line-NETPR = tmpxvbapNETPR. 
 
  xvbap_line-KZWI1 = tmpxvbapKZWI1.
  xvbap_line-KZWI2 = tmpxvbapKZWI2. 
  xvbap_line-KZWI3 = tmpxvbapKZWI3. 
  xvbap_line-KZWI4 = tmpxvbapKZWI4. 
  xvbap_line-KZWI5 = tmpxvbapKZWI5. 
  xvbap_line-KZWI6 = tmpxvbapKZWI6. 
 
  MODIFY XVBAP FROM xvbap_line INDEX idx. 
 ENDLOOP. 
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 16:06:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-from-a-set-material-with-components-xvbap-tkomv/m-p/7615178#M1569775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-12T16:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation from a set material with components (XVBAP/TKOMV)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-from-a-set-material-with-components-xvbap-tkomv/m-p/7615179#M1569776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Problem was, that the customer had a z-program at the end of the hole price finding process, whiche recalculate the hole thing, thats why it wasnt working. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 05:11:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-from-a-set-material-with-components-xvbap-tkomv/m-p/7615179#M1569776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-09T05:11:04Z</dc:date>
    </item>
  </channel>
</rss>

