Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module Doubt

Former Member
0 Likes
605

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

5 REPLIES 5
Read only

Former Member
0 Likes
570

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

Read only

0 Likes
570

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

Read only

Former Member
0 Likes
570

Create the variable XEY in the global TOP include of the function group.In this way both your functions can access this variable.

Read only

Former Member
0 Likes
570

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

Read only

Former Member
0 Likes
570

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.