<?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: Passing internal table to subroutine - Difference between  Head value and Table contents in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542215#M20243</link>
    <description>&lt;P&gt;Thank you for your answers. As you said, it is right to use 'Read Table'.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2017 08:53:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-10-17T08:53:58Z</dc:date>
    <item>
      <title>SAP Script: Passing internal table to subroutine - Difference between  Head value and Table contents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542212#M20240</link>
      <description>&lt;P&gt;Hallo expert!&lt;/P&gt;
  &lt;P&gt;Status: just after DB Conversion from oracle to HANA &lt;/P&gt;
  &lt;P&gt;I am working on SAP script and I made a subroutine for that as following. &lt;/P&gt;
  &lt;P&gt;-------------------------------------------------------------------------------&lt;/P&gt;
  &lt;P&gt;PERFORM SALDO_EVALUATE IN PROGRAM ZIMWADR0 &lt;/P&gt;
  &lt;P&gt;USING &amp;amp;RF140-SALDO&amp;amp; &lt;/P&gt;
  &lt;P&gt;CHANGING &amp;amp;LV_SALDO&amp;amp; ENDPERFORM&lt;/P&gt;
  &lt;P&gt;-----------------------------------------------------------------------------&lt;/P&gt;
  &lt;P&gt;It didn't work good. So I debugged it. &lt;/P&gt;
  &lt;P&gt;When i was debuggin it, I found very interested thing.&lt;/P&gt;
  &lt;P&gt;----------------------------------------------------------------------------&lt;/P&gt;
  &lt;P&gt;FORM saldo_evaluate &lt;/P&gt;
  &lt;P&gt;TABLES itab STRUCTURE itcsy&lt;BR /&gt; otab STRUCTURE itcsy.&lt;/P&gt;
  &lt;P&gt;-----------------------------------------------------------------------------&lt;/P&gt;
  &lt;P&gt;I used otab as output table. and its head value was filled with not LV_SALDO but lV_TEXT which is a different local variable in same SAP Script and was used for another subroutine just before. and its content was filled with LV_SALDO.&lt;/P&gt;
  &lt;P&gt;exactly to saying: &lt;/P&gt;
  &lt;P&gt;otab( head value): LV_TEXT Text 3 &lt;/P&gt;
  &lt;P&gt;otab[] (Table contents): LV_SALDO &lt;/P&gt;
  &lt;P&gt;Therefore table otab has different value in head value and in contents.&lt;/P&gt;
  &lt;P&gt;I checked these values just after subroutine just called.&lt;/P&gt;
  &lt;P&gt;I didn't see such a thing ever. If you have any idea, could please help me to find out the reason of this situation and solution, please?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 11:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542212#M20240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-13T11:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Script: Passing internal table to subroutine - Difference between  Head value and Table contents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542213#M20241</link>
      <description>&lt;P&gt;I'm guessing you need to clear the unwanted variable from the header then? Not sure what is the predicament exactly... There are very many posts online explaining how the SAPscript subroutines work, &lt;A href="https://menoshet.wordpress.com/2010/07/20/adding-code-to-sap-script/"&gt;this blog&lt;/A&gt; is just from the top of the Google search.&lt;/P&gt;
  &lt;P&gt;But this day and age I'd really suggest to start replacing SAPScripts with PDF forms or at least Smartforms. SAPScript won't be supported in S/4HANA (thankfully).&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 18:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542213#M20241</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2017-10-13T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Script: Passing internal table to subroutine - Difference between  Head value and Table contents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542214#M20242</link>
      <description>&lt;P&gt;It seems that the OP is thinking that the header line of parameter otab should be initialized by SAP to be equal to the first line of otab.&lt;/P&gt;
  &lt;P&gt;But of course you &lt;STRONG&gt;should never rely on the header line&lt;/STRONG&gt; but always use &lt;STRONG&gt;READ TABLE&lt;/STRONG&gt; otab (and same thing for itab).&lt;/P&gt;
  &lt;P&gt;As Jelena suggests, the blog posts show the right way to access itab and otab (i.e. you must not take into account the header line transmitted), and it's also shown in the official documentation : &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/saphelp_nw70/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm"&gt;https://help.sap.com/saphelp_nw70/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 08:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542214#M20242</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-10-14T08:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Script: Passing internal table to subroutine - Difference between  Head value and Table contents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542215#M20243</link>
      <description>&lt;P&gt;Thank you for your answers. As you said, it is right to use 'Read Table'.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 08:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-passing-internal-table-to-subroutine-difference-between-head/m-p/542215#M20243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-10-17T08:53:58Z</dc:date>
    </item>
  </channel>
</rss>

