<?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 Global Variable assignment operation not working (Works with local variable) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748074#M2021531</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;We have a global variable with name wa_pb_file_recxyab of type ty_pb_file_recxya.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;data: wa_pb_file_recxyab     TYPE ty_pb_file_recxya.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Inside one of my subroutines, when i try the below, nothing gets assigned to wa_pb_file_recxyab &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;wa_pb_file_recxyab+0(4) = 'test'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But when i declare a local variable right before the line and try, it works&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;data: lwa_pb_file_recxyab type ty_pb_file_recxya.
lwa_pb_file_recxyab+0(4) = 'test'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;What am i missing. Please help.&lt;/P&gt;
  &lt;P&gt;Structure of TY_PB_FILE_REC03A is&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt; TYPES :  BEGIN OF ty_pb_file_recxya.
            INCLUDE STRUCTURE zst_ab_charges.
            TYPES: item_data(21) TYPE c.
            INCLUDE STRUCTURE zst_ab_charges_b.
            TYPES: premise       TYPE eanl-vstelle,
            ext_ui        TYPE euitrans-ext_ui,
          END OF ty_pb_file_rec03a.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;Joshua.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 16:54:37 GMT</pubDate>
    <dc:creator>vapor_anomaly</dc:creator>
    <dc:date>2023-09-07T16:54:37Z</dc:date>
    <item>
      <title>Global Variable assignment operation not working (Works with local variable)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748074#M2021531</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;We have a global variable with name wa_pb_file_recxyab of type ty_pb_file_recxya.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;data: wa_pb_file_recxyab     TYPE ty_pb_file_recxya.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Inside one of my subroutines, when i try the below, nothing gets assigned to wa_pb_file_recxyab &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;wa_pb_file_recxyab+0(4) = 'test'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But when i declare a local variable right before the line and try, it works&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;data: lwa_pb_file_recxyab type ty_pb_file_recxya.
lwa_pb_file_recxyab+0(4) = 'test'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;What am i missing. Please help.&lt;/P&gt;
  &lt;P&gt;Structure of TY_PB_FILE_REC03A is&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt; TYPES :  BEGIN OF ty_pb_file_recxya.
            INCLUDE STRUCTURE zst_ab_charges.
            TYPES: item_data(21) TYPE c.
            INCLUDE STRUCTURE zst_ab_charges_b.
            TYPES: premise       TYPE eanl-vstelle,
            ext_ui        TYPE euitrans-ext_ui,
          END OF ty_pb_file_rec03a.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;Joshua.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 16:54:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748074#M2021531</guid>
      <dc:creator>vapor_anomaly</dc:creator>
      <dc:date>2023-09-07T16:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Global Variable assignment operation not working (Works with local variable)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748075#M2021532</link>
      <description>&lt;P&gt;I guess that "it works" means that debug after the line doesn't show the change.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Either you didn't activate your program,&lt;/LI&gt;&lt;LI&gt;or you didn't restart the program after compiling,&lt;/LI&gt;&lt;LI&gt;or the global variable is shadowed by attribute (class/interface/alias) with same name, etc.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Sometimes, we developers don't see obvious errors. Just ask a fellow developer of yours to have a second look at it. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 04:02:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748075#M2021532</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-08T04:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Global Variable assignment operation not working (Works with local variable)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748076#M2021533</link>
      <description>&lt;P&gt;Activate the code that contains the "global variable" (whether it's a class attribute, a top include, or anything else).&lt;/P&gt;&lt;P&gt;Try again to generate your program/class (or double-click on the field name in the method/role source, if it is indeed a global variable, its definition should be displayed).&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 07:57:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748076#M2021533</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-09-08T07:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Global Variable assignment operation not working (Works with local variable)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748077#M2021534</link>
      <description>&lt;P&gt;Thanks Sandra.&lt;/P&gt;&lt;P&gt;Your point 3 is the reason.&lt;/P&gt;&lt;P&gt;I discovered that the programmer has added a loop further down the line, within same subroutine, with a dynamic data field with same name! &lt;/P&gt;&lt;P&gt;Once i corrected it, it worked.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab....into data(wa_pb_file_recxyab)...
......&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joshua.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 08:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748077#M2021534</guid>
      <dc:creator>vapor_anomaly</dc:creator>
      <dc:date>2023-09-08T08:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Global Variable assignment operation not working (Works with local variable)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748078#M2021535</link>
      <description>&lt;P&gt;Thanks for the feedback!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 14:32:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/global-variable-assignment-operation-not-working-works-with-local-variable/m-p/12748078#M2021535</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-09T14:32:59Z</dc:date>
    </item>
  </channel>
</rss>

