‎2006 Sep 07 7:00 AM
Dear Experts,
I have Function Group - A which contains one Function Module A1 and Function group B which contains one Function Module B1,
The FM A1 contains variable XEY with the value 100,
Now my problem is i need to access the XEY variable with the value in the FM B1.
Could any one help me to do this?
Thanks in advance
‎2006 Sep 07 7:06 AM
Hi,
If that variable is the EXPORTING paramater of FM A1 then call this function in FM B1.
If it is not the EXPORTING parameter then you have to create a new function moduel which will return that value.
Thanks and Regards,
Bharat Kumar Reddy.V
‎2006 Sep 07 7:17 AM
Hi,
try that:
var1 is your local variable in Program zprog1.
in zprog2 you assign above-named variable :
ASSIGN ('(ZPROG1)VAR1') TO <fs>.
this code is from the foll. link
dirty assign
http://www.apentia-forum.de/viewtopic.php?t=5784&highlight=dirty+assign
regards Andreas
Message was edited by: Andreas Mann
‎2006 Sep 07 7:17 AM
Create the variable XEY in the global TOP include of the function group.In this way both your functions can access this variable.
‎2006 Sep 07 8:59 AM
Hi,
In the 1st FM :
FUNCTION A1.
Data XEY TYpE n.
...
...
....
<b>EXPORT XEY TO MEMORY.</b>
ENDFUNCTION.
In the 2nd FM :
FUNCTION B1.
DATA XEY type n.
<b>IMPORT XEY FROM MEMORY.</b>
...
....
.....
ENDFUNCTION.
Best regards,
Prashant
‎2006 Sep 07 9:03 AM
U can EXPORT and IMPORT the variable in the function modules but the advice would be if the FM are related you can define them in the same group by that the variable is available globally within that group.