<?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: Header line data type changes when passed to subroutine in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553365#M1658392</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Development, once inside the subroutine, header line IT_ZPA2005 still has the type as the table passed which is ZPA2003.&lt;/P&gt;&lt;P&gt;In Production, once inside the subroutine, header line IT_ZPA2005 &lt;EM&gt;changes&lt;/EM&gt; type to PA2003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correction above, I meant header line &lt;STRONG&gt;IT_ZPA2003&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alexandra Co on Feb 8, 2012 12:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2012 11:21:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-02-08T11:21:05Z</dc:date>
    <item>
      <title>Header line data type changes when passed to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553362#M1658389</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;We have an existing problem in Production wherein the program encounters ABAP dump (details below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OBJECTS_WA_NOT_COMPATIBLE

Error analysis
    The statement
       "DELETE TABLE itab FROM wa ..."
    requires the lines of the internal table "IT_ZPA2003[]" and the
    work area " wa" to be compatible. Compatibility means
    equivalence in the context of ABAP/4 type checking.

    In this case, the condition is not satisfied because the internal table
    "IT_ZPA2003[]" has the line type "ZPA2003" and the length 301, but the work
     area " wa"
    has the type "PA2003" and the length 269.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For our common reference, ZPA2003 is really different from PA2003. ZPA2003 has additional customized fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the problematic code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION ZSHIFT_DELIMIT.
...
DATA: it_zpa2003 LIKE zpa2003 OCCURS 0 WITH HEADER LINE. 
  ...
  PERFORM delimit TABLES itab
                         it_zpa2003                            
                         new_records
                         old_records
                         it_old
                         temp_zpa2003.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the definition of the subroutine &lt;EM&gt;delimit&lt;/EM&gt; :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM delimit  TABLES itab         STRUCTURE zpa2003
                     it_zpa2003   STRUCTURE pa2003 " This seems wrong, should be ZPA2003
                     new_records  STRUCTURE zpa2003
                     old_records  STRUCTURE zpa2003
                     it_old       STRUCTURE zpa2003
                     temp_zpa2003 STRUCTURE zpa2003.

  LOOP AT it_zpa2003 
    WHERE ( begda LE itab-begda AND endda GE itab-begda )
      OR ( begda LE itab-endda AND  endda GE itab-endda )
      OR ( begda GE itab-begda AND  endda LE itab-endda ).
            ...
            DELETE TABLE it_zpa2003.
            ...
  ENDLOOP.

ENDFORM.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is code already existing in Production, so pardon the usage of obsolete statements. &lt;/P&gt;&lt;P&gt;i.e. internal table with header line, passing using TABLES for subroutine&lt;/P&gt;&lt;P&gt;And yes, the variable name of the internal table in the FM is the same as the variable name of the receiving parameter in the subroutine (i.e. IT_ZPA2003).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway if you look at the code, there really is a problem since in the Function Module *it_zpa2003* is defined as *ZPA2003* while in the subroutine, the structure is defined to be *PA2003* only (no Z).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The weird part is -- this code is actually working in our Development environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, the tables are the same versions, the function modules have the same versions, the include programs have the same versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to debug this, and observed the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Development, once inside the subroutine, header line IT_ZPA2005 still has the type as the table passed which is ZPA2003.&lt;/P&gt;&lt;P&gt;In Production, once inside the subroutine, header line IT_ZPA2005 &lt;EM&gt;changes&lt;/EM&gt; type to PA2003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not all that familiar as to how SAP actually executes ABAP code. We're not really sure as well if our SysAds updated anything in the backend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone can shed some light as to why the behavior is different.&lt;/P&gt;&lt;P&gt;I've tried to debug and the ABAP code is identical line per line...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As additional data, we have 2 other boxes -- Sandbox and Testing environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Development and Sandbox behave the same --the header line data type does not change.&lt;/P&gt;&lt;P&gt;Testing and Production behave the same  -- the header line data type changes to the defined structure in the subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, our Sandbox was refreshed from Production middle of last year, then our Testing was refreshed late last year, both from Production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alexandra Co on Feb 8, 2012 12:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 11:03:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553362#M1658389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-08T11:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Header line data type changes when passed to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553363#M1658390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What i feel is that in development the structure PA2003 matches with ZPA2003. The custom fields would be existing in  PA2003 and both the structure could be similar in Development. In production PA2003 will not be having any changes. May be the extended syntax check or the code inspector check will help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 11:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553363#M1658390</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-02-08T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Header line data type changes when passed to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553364#M1658391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Development, ZPA2003 is really not identical to PA2003.&lt;/P&gt;&lt;P&gt;In debugging I can see that the table IT_ZPA2003 has length 303 which is the length of the Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But thanks though. I am wondering if this is even the correct forum to post this, or if this should be in Application Server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 11:19:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553364#M1658391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-08T11:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Header line data type changes when passed to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553365#M1658392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Development, once inside the subroutine, header line IT_ZPA2005 still has the type as the table passed which is ZPA2003.&lt;/P&gt;&lt;P&gt;In Production, once inside the subroutine, header line IT_ZPA2005 &lt;EM&gt;changes&lt;/EM&gt; type to PA2003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correction above, I meant header line &lt;STRONG&gt;IT_ZPA2003&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alexandra Co on Feb 8, 2012 12:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 11:21:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553365#M1658392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-08T11:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Header line data type changes when passed to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553366#M1658393</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;One more query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You dump says&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{quote]&lt;/P&gt;&lt;P&gt;"DELETE TABLE itab FROM wa ..." requires the lines of the internal table "IT_ZPA2003[]"&lt;/P&gt;&lt;P&gt;{quote}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Development , is the control reaching this delete statement ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA has less fields than the internal table ITAB. So try changing the structure of WA to that of the internal table and re transport it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 12:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-line-data-type-changes-when-passed-to-subroutine/m-p/8553366#M1658393</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-02-08T12:43:21Z</dc:date>
    </item>
  </channel>
</rss>

