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

Access to variables from calling subprogram using field-symbols

Former Member
0 Likes
3,498

Hi all,

We can use a variable from calling programs using field-symbols like:

data: str(30) type c value '(prog)var'.

field-symbols:

<fs> type any.

assign str to <fs>.

The variable var is global in the program.

Can I use a variable if it defines inside of the calling form/function as a local variable.

Ivan.

Hi all,

We can use a variable from calling programs using field-symbols like:

data: str(30) type c value '(prog)var'.

field-symbols:

<fs> type any.

assign str to <fs>.

The variable var is global in the program.

Can I use a variable if it defines inside of the calling form/function as a local variable.

Ivan.

2 REPLIES 2
Read only

Former Member
0 Likes
818

No.

I have checked it with forms, it has no reference possible to 'local' variables. I assume it to be the same for functions.

cheers,

Read only

andreas_mann3
Active Contributor
0 Likes
818

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

<a href="http://www.abapforum.com/forum/viewtopic.php?t=573&highlight=dirty+assign">dirty assign</a>

regards Andreas