<?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: Total Problem in scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019463#M413151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  when i clear v_extpr_tot1.then it's clear the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  for example i have 3 line items.then at this time it's displaying 3rd line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  i.e: 1 st line item is having 10&lt;/P&gt;&lt;P&gt;       2 nd line item is having 20&lt;/P&gt;&lt;P&gt;       3 rd  line item is having 30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; here we need to calculate 10&lt;EM&gt;20&lt;/EM&gt;30---. 60&lt;/P&gt;&lt;P&gt;but when we use clear v_extpr_tot1 then it displays -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt;total value is 60 only,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please send ur valuble suggestions for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2007 19:56:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-23T19:56:57Z</dc:date>
    <item>
      <title>Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019459#M413147</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'm facing one big issue in scripts.ie: in printing totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  for totals i write a subroutine in scripts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  it's working fine.it's displaying totals well.here my problem is first i see the print preview.at that time total is correct.but when i came back and see the print preview again it displaying wrong.ie if first time the total is 'A'.Then second time it displaying like (A+A).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  other problem is when i see the print preview and displays it and go back and took the print at that time also it displaying (A+A).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My code is like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  GET_EXTPR_TOT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    this routine will get the LINE ITEM EXTENDED PRICE TOTALS When&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    there is no PROMO CODE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_extpr_tot tables it_input structure itcsy it_output structure itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: v_vbeln2(10) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear it_input.&lt;/P&gt;&lt;P&gt;  clear v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table it_input index 1.&lt;/P&gt;&lt;P&gt;  move it_input-value to v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table it_input index 2.&lt;/P&gt;&lt;P&gt;  move it_input-value to v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table it_output index 1.&lt;/P&gt;&lt;P&gt;  write v_extpr_tot1 to it_output-value left-justified.&lt;/P&gt;&lt;P&gt;  modify it_output index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear it_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    "GET_EXTPR_TOT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Send ur valuable answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 17:44:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019459#M413147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T17:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019460#M413148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try clearing the variable as show below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Form GET_EXTPR_TOT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this routine will get the LINE ITEM EXTENDED PRICE TOTALS When&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;there is no PROMO CODE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_extpr_tot tables it_input structure itcsy it_output structure itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_vbeln2(10) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_input.&lt;/P&gt;&lt;P&gt;clear v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_input index 1.&lt;/P&gt;&lt;P&gt;move it_input-value to v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_input index 2.&lt;/P&gt;&lt;P&gt;move it_input-value to v_extpr_tot.&lt;/P&gt;&lt;P&gt;v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear v_extpr_tot1.&amp;lt;/b&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;read table it_output index 1.&lt;/P&gt;&lt;P&gt;write v_extpr_tot1 to it_output-value left-justified.&lt;/P&gt;&lt;P&gt;modify it_output index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        SKJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 17:53:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019460#M413148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T17:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019461#M413149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivasa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are not clearing the value of v_extpr_tot1 after moving to the totals and you maintained this as global one in the program, so its scope will be entire program.&lt;/P&gt;&lt;P&gt;So, clear this value and re run the script once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_vbeln2(10) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_input.&lt;/P&gt;&lt;P&gt;clear v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_input index 1.&lt;/P&gt;&lt;P&gt;move it_input-value to v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_input index 2.&lt;/P&gt;&lt;P&gt;move it_input-value to v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_output index 1.&lt;/P&gt;&lt;P&gt;write v_extpr_tot1 to it_output-value left-justified.&lt;/P&gt;&lt;P&gt;modify it_output index 1.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear v_extpr_tot1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;clear it_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 17:56:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019461#M413149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T17:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019462#M413150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivasa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have defined the variable  v_extpr_tot1 as a global variable in external program, instead you should be defining it in the script (MAIN windows )and passing in as an input to the perform. That way when you reexecute the script (i.e go back into print preview for the second time ) it will be redefined and cleared. And your totals will not change even you repeatedly go back into print preview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kalyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 18:22:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019462#M413150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T18:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019463#M413151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  when i clear v_extpr_tot1.then it's clear the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  for example i have 3 line items.then at this time it's displaying 3rd line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  i.e: 1 st line item is having 10&lt;/P&gt;&lt;P&gt;       2 nd line item is having 20&lt;/P&gt;&lt;P&gt;       3 rd  line item is having 30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; here we need to calculate 10&lt;EM&gt;20&lt;/EM&gt;30---. 60&lt;/P&gt;&lt;P&gt;but when we use clear v_extpr_tot1 then it displays -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt;total value is 60 only,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please send ur valuble suggestions for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 19:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019463#M413151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T19:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019464#M413152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  can u give some clear view with small example please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 20:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019464#M413152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T20:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019465#M413153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must be calling this routine some where in a loop. Make sure that you clear the variable "v_extpr_tot1" before entering the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem. If this solution did not solve your problem then paste the code from where you are calling this subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy SAP. Reward points if this solution is useful&lt;/P&gt;&lt;P&gt;Rajasekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Mar 2007 01:56:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019465#M413153</guid>
      <dc:creator>rajasekhar_matukumalli3</dc:creator>
      <dc:date>2007-03-24T01:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019466#M413154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  im calling that from scripts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in se71:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/E  ITEM_LINE_PRICE_QUANTITY&lt;/P&gt;&lt;P&gt;/*   Begin of modification (RICEF/Issue Number:F-SD-04) by sbhavanam&lt;/P&gt;&lt;P&gt;/:   PERFORM GET_EXTPR_TOT IN PROGRAM ZSP_SD_ORDCM.&lt;/P&gt;&lt;P&gt;/:   USING &amp;amp;VBDKA-VBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/:   USING &amp;amp;V_PRICE&amp;amp;&lt;/P&gt;&lt;P&gt;/:   CHANGING &amp;amp;V_EXTPR_TOT1&amp;amp;&lt;/P&gt;&lt;P&gt;/:   ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ABAP code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_extpr_tot TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: v_vbeln2(10) TYPE n&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CLEAR it_input.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   CLEAR v_vbeln2.&lt;/P&gt;&lt;P&gt;   CLEAR v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_input INDEX 1.&lt;/P&gt;&lt;P&gt;  MOVE it_input-value TO v_vbeln2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_input INDEX 2.&lt;/P&gt;&lt;P&gt;  MOVE it_input-value TO v_extpr_tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; v_extpr_tot_tst = v_extpr_tot_&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE it_output INDEX 1.&lt;/P&gt;&lt;P&gt;  WRITE v_extpr_tot1 TO it_output-value LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;  MODIFY it_output INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR it_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    "GET_EXTPR_TOT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please send ur valuable input's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 12:41:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019466#M413154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T12:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019467#M413155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;In your script you can define the total variable in one of the header related elements that will be called. for exaple you can define it in the element &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
/E HEADER_TARGET_VALUE
/: DEFINE &amp;amp;V_EXTPR_TOT1&amp;amp; = ' '
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and change your code in ITEM_LINE_PRICE_QUANTITY element as follows &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
/E ITEM_LINE_PRICE_QUANTITY
/* Begin of modification (RICEF/Issue Number:F-SD-04) by sbhavanam
/: PERFORM GET_EXTPR_TOT IN PROGRAM ZSP_SD_ORDCM.
/: USING &amp;amp;VBDKA-VBELN&amp;amp;
/: USING &amp;amp;V_PRICE&amp;amp;
/: CHANGING &amp;amp;V_EXTPR_TOT1&amp;amp;
/: ENDPERFORM
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your abap should look like this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM get_extpr_tot TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.

DATA: v_vbeln2(10) TYPE n
.

* CLEAR it_input.
CLEAR v_vbeln2.
CLEAR v_extpr_tot.

READ TABLE it_input INDEX 1.
MOVE it_input-value TO v_vbeln2.

READ TABLE it_input INDEX 2.
MOVE it_input-value TO v_extpr_tot.

read table it_input index 3.
move it_input-value to v_extpr_tot1.

v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.
* v_extpr_tot_tst = v_extpr_tot_
READ TABLE it_output INDEX 1.
WRITE v_extpr_tot1 TO it_output-value LEFT-JUSTIFIED.
MODIFY it_output INDEX 1.

CLEAR it_output.


ENDFORM. "GET_EXTPR_TOT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;that should solve your issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kalyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 13:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019467#M413155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T13:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Total Problem in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019468#M413156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's working fine.thanks for ur reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 14:45:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-problem-in-scripts/m-p/2019468#M413156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T14:45:06Z</dc:date>
    </item>
  </channel>
</rss>

