<?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: Assign value to global variables in a different function group in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664011#M882571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to have some function module in function group B to modify that variable of function group B.&lt;/P&gt;&lt;P&gt;You can not alter its value from different function group. However you can access its value by using calling stack . For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: GW_FIELD(60)   TYPE C,&lt;/P&gt;&lt;P&gt;        L_WBSTK        TYPE VBUK-WBSTK.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;GW_WBSTK_VAL&amp;gt; TYPE VBUK-WBSTK.&lt;/P&gt;&lt;P&gt;  CLEAR: GW_FIELD, L_WBSTK.&lt;/P&gt;&lt;P&gt;  MOVE '(SAPMV50A)XVBUK-WBSTK' TO GW_FIELD.&lt;/P&gt;&lt;P&gt;  ASSIGN (GW_FIELD) TO &amp;lt;GW_WBSTK_VAL&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF &amp;lt;GW_WBSTK_VAL&amp;gt; IS ASSIGNED.&lt;/P&gt;&lt;P&gt;    L_WBSTK = &amp;lt;GW_WBSTK_VAL&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G@urav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2008 15:51:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-07T15:51:53Z</dc:date>
    <item>
      <title>Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664008#M882568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best way of assigning values in the caller program to some global variables defined in the TOP include of a different function group? The one way I know of, which is to create a new function module in the target function group and pass the data via import parameters is not feasible for our development because that would be considered a standard code modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem can be described as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Caller Function Group : A&lt;/P&gt;&lt;P&gt;Program: caller_program&lt;/P&gt;&lt;P&gt;Pseudo code: &lt;/P&gt;&lt;P&gt;gv_var_1 = 'A'&lt;/P&gt;&lt;P&gt;call function 'USE_GV_VAR'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Called (Target) Function group : B&lt;/P&gt;&lt;P&gt;Top include : LBTOP &lt;/P&gt;&lt;P&gt;LBTOP Code: Data: gv_var_1(1).&lt;/P&gt;&lt;P&gt;Function Module: USE_GV_VAR &lt;/P&gt;&lt;P&gt;USE_GV_VAR Code: if gv_var_1 == 'A'&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;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 22:42:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664008#M882568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T22:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664009#M882569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One idea could be:&lt;/P&gt;&lt;P&gt;1. Create a new Z-Function group.&lt;/P&gt;&lt;P&gt;2. copy your two function modules from Group A and group B to the Z-group under the name with prefix Z.&lt;/P&gt;&lt;P&gt;3. both TOP-includes have to be combined properly (I guess you can't use both TOP include together. This caused naming problems - probably?!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you have access to all the TOP-fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think about it. May be it works; or it gives you another idea for a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have luck,&lt;/P&gt;&lt;P&gt;Heinz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Apr 2008 03:37:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664009#M882569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-05T03:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664010#M882570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Heinz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Accessing the variable by name is not the concern, but to access and assign value to the variable that is in the roll area of Function Group of B. Even Function Group A can make use of a variable named gv_var_1, it is in the roll area of A, not B. Hence when the function module in B is called, the variable gv_var_1 there is still initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 15:47:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664010#M882570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T15:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664011#M882571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to have some function module in function group B to modify that variable of function group B.&lt;/P&gt;&lt;P&gt;You can not alter its value from different function group. However you can access its value by using calling stack . For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: GW_FIELD(60)   TYPE C,&lt;/P&gt;&lt;P&gt;        L_WBSTK        TYPE VBUK-WBSTK.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;GW_WBSTK_VAL&amp;gt; TYPE VBUK-WBSTK.&lt;/P&gt;&lt;P&gt;  CLEAR: GW_FIELD, L_WBSTK.&lt;/P&gt;&lt;P&gt;  MOVE '(SAPMV50A)XVBUK-WBSTK' TO GW_FIELD.&lt;/P&gt;&lt;P&gt;  ASSIGN (GW_FIELD) TO &amp;lt;GW_WBSTK_VAL&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF &amp;lt;GW_WBSTK_VAL&amp;gt; IS ASSIGNED.&lt;/P&gt;&lt;P&gt;    L_WBSTK = &amp;lt;GW_WBSTK_VAL&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G@urav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 15:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664011#M882571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T15:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664012#M882572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Gaurav. I needed this hint just today. Saved me from making a modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 13:28:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664012#M882572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-10T13:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to global variables in a different function group</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664013#M882573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 11:38:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-value-to-global-variables-in-a-different-function-group/m-p/3664013#M882573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-01T11:38:51Z</dc:date>
    </item>
  </channel>
</rss>

