Application Development 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: 

Access variables of caller (program)

Former Member
0 Kudos

Hi there,

following situation:

A program calls a standard function module. This function module calls many subsequent function modules.

One of those subsequent function modules is a self created user-exit.

In there I want to access variables (the input parameters) from the caller. What's the best possibility to achieve that?

Z_INPUT

     -> FM1

          -> FM2

               -> Z_FM3

                    Access variables from Z_INPUT

Should i save the required information in a shared object?

Or would it be better to directly access the variables on the stack: (Z_INPUT)variable?

Any other solutions?

Thanks in advance!

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Andreas,

I would not use the ABAP stack to access the variable -

  • Directly accessing the ABAP stack via ASSIGN (prog_name)variable is not released for customers. I tend to use it only in cases where there's no other way to access a global variables (of standard programs).
  • If the variable in question is a local variable, then you cannot access it via ABAP stack.

So i would save the variable in the (relevant)memory & access it later in the exit FM

BR,

Suhas

2 REPLIES 2

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Andreas,

I would not use the ABAP stack to access the variable -

  • Directly accessing the ABAP stack via ASSIGN (prog_name)variable is not released for customers. I tend to use it only in cases where there's no other way to access a global variables (of standard programs).
  • If the variable in question is a local variable, then you cannot access it via ABAP stack.

So i would save the variable in the (relevant)memory & access it later in the exit FM

BR,

Suhas

Former Member
0 Kudos

OK, thanks!

Then I'll use a shared object to "pass" the required information.