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: 

Function Module to read stack values.

Former Member
0 Kudos

Hello,

Is there is any function module to read the stack values.

My requirement is

I have 3 FM modules say FM_A, FM_B & FM_C.

FM_A will call FM_C.

FM_B will call FM_C.

In FM_C, I need to identify whether the call has been made from FM_A or FM_B without changing these two function modules and by changing only FM_C.

Please help me out.

Thx.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

How about FM 'SYSTEM_CALLSTACK'?

4 REPLIES 4

Former Member
0 Kudos

Hi to get the called function module name in FM_C add one more paramter to differentiate the called functionmodule and pass the value while calling the fm_c and check the same in fm_c.

Do award points if usefull

Former Member
0 Kudos

...without changing these two function modules ...

If FM_A & FM_B in ont functional group - no way.

If functional groups of these FM is defferent you can try get any variable from top include.

Need add procedure in FM_C

ASSIGN ('(SAPLxxxx)yyyy') TO <FS>, where

xxxx - function group name

yyyy - variable from top include

IF field-symbol is assigned - FM from this group started our FM.

That's will worked only if new LUW started and modules called by once. Very ugly method and not 100% garanty, but I don't know any else.

Former Member
0 Kudos

Hi,

How about FM 'SYSTEM_CALLSTACK'?

0 Kudos

Roger Zhong ... Your reply was to the point.

Thanks a lot.