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: 

CUrrent Function module name

Former Member
0 Kudos

Dear All,

Is there any way to check from which function module the current piece of code called from? I need to know the current function module name during runtime. For current program sy-repid, current date is sy-datum, like wise any system field or any other way to know the current function name.

Thanks

Reddy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Guys,

Thanks for reply. SY-CPROG is current program not the function name. Break point, nope I need to write piece of code in based on current function name. As you guys know in sales order sales code is called by number of function modules. Any function module is available to get current function name?

Thanks

Reddy

5 REPLIES 5

Former Member
0 Kudos

Hi shekar

to find the current function call, create a breakpoint in that part of the program then it will open the debugger. in the debugger goto CALLS there you can find the Function Calls i.e from which FM it is called.

regards

kishore

suresh_datti
Active Contributor
0 Kudos

Hi,

You can try the system variable SY-CPROG.

Regards,

Suresh Datti

Former Member
0 Kudos

Hi Guys,

Thanks for reply. SY-CPROG is current program not the function name. Break point, nope I need to write piece of code in based on current function name. As you guys know in sales order sales code is called by number of function modules. Any function module is available to get current function name?

Thanks

Reddy

0 Kudos

HI shekar

then try using 'ABAP_CALLSTACK' functional module in which the Calls in the program is stored.

regards

kishore

0 Kudos

Try function module SYSTEM_CALLSTACK.

Regards,

Yann