<?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: SAP script variable caluclation incorrect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-variable-caluclation-incorrect/m-p/7731510#M1581016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAPScript standard process: In your subroutine for the perform, you must read your input table of type itcsy....calculate all your values in the subroutine......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form GET_FINAL tables in_par structure itcsy
                                     out_par structure itcsy.

read table in_par index 1.  
   lv_pernr = in_par-value.   "first USING
read table in_par index 2.
lv_TCCST = in_par-value.   "2nd USING value

* do your stuff.

read table out_par index 1.
  out_par-value = some_field. "first changing value FINAL
modify out_par index 1.   
read table out_par index 2.    "your VTEST becomes a changing parameter
out_par-value = your other calculations
modify out_par index 2.
endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Edited by: BreakPoint on Mar 14, 2011 7:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2011 18:10:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-03-14T18:10:06Z</dc:date>
    <item>
      <title>SAP script variable caluclation incorrect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-variable-caluclation-incorrect/m-p/7731509#M1581015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a SAP script and within that i have the following code written: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/:	 	IF &amp;amp;CHOICE&amp;amp; = '1'
/:	 	PERFORM GET_FINAL IN PROGRAM ZTEST
/:	 	USING     &amp;amp;RPBEN_DA-PERNR&amp;amp;
/:	 	USING     &amp;amp;RPBEN_DA-TCCST&amp;amp;:	 	
/:	 	CHANGING  &amp;amp;FINAL&amp;amp;
/:	 	ENDPERFORM&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;now I want to modify the value of &amp;amp;FINAL&amp;amp;... I need to some calculation and based on that I want to set the values for ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/:                v_num = 2.
/:                 V_test = FINAL * V_num.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But when I debug v_test is coming out to be zero and FINAL does have a value in it. can you please tell me what I might be doing wrong here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 17:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-variable-caluclation-incorrect/m-p/7731509#M1581015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-14T17:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAP script variable caluclation incorrect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-variable-caluclation-incorrect/m-p/7731510#M1581016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAPScript standard process: In your subroutine for the perform, you must read your input table of type itcsy....calculate all your values in the subroutine......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form GET_FINAL tables in_par structure itcsy
                                     out_par structure itcsy.

read table in_par index 1.  
   lv_pernr = in_par-value.   "first USING
read table in_par index 2.
lv_TCCST = in_par-value.   "2nd USING value

* do your stuff.

read table out_par index 1.
  out_par-value = some_field. "first changing value FINAL
modify out_par index 1.   
read table out_par index 2.    "your VTEST becomes a changing parameter
out_par-value = your other calculations
modify out_par index 2.
endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Edited by: BreakPoint on Mar 14, 2011 7:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 18:10:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-variable-caluclation-incorrect/m-p/7731510#M1581016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-14T18:10:06Z</dc:date>
    </item>
  </channel>
</rss>

