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

Dynamically getting module name in program

Former Member
0 Likes
1,335

Hello All,

Is there any way by which we can get the module name, i.e. are  we currently in PAI module or PBO in program execution, means is there any system variable which gets dynamically updated or can we get through any FM call. Urgent help would be greatly acknowledged.

With regards.

8 REPLIES 8
Read only

Former Member
0 Likes
1,114

Hi

If you want to see in the debugging you can find abap stack, screen stack in tools.

regards

laxman

Read only

0 Likes
1,114

Not in the debugging mode, but in the program.

Read only

0 Likes
1,114

hi

check thi sFM  SYSTEM_CALLSTACK

in this you wil get ABAP STACK.

logic:::

data: t_evnt TYPE ABAP_CALLSTACK.

   CALL FUNCTION 'SYSTEM_CALLSTACK'

*   EXPORTING

*     MAX_LEVEL          = 0

    IMPORTING

      CALLSTACK          = t_evnt

*     ET_CALLSTACK       =


in t_evnt structure you wil have thae details.

Read only

venuarun
Active Participant
0 Likes
1,114

Hi Harsh,

You check it this  in debugging. In debugging the desktop 2 (New debugger) will give you  in which module your control is at .

With regards

Arun VS

Read only

Phillip_Morgan
Contributor
0 Likes
1,114

Hi,

There is a function module that can give you the information but I think that it only gives programs and function modules. It is often used in user exits.

Maybe look for a class in the RTTS classes (runtime type services).

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,114

Hi,

Not possible in SYST. SY-CPROG only gives you the module pool.

Read only

0 Likes
1,114

Hi Jain,

   In debug mode i can find the Modulename  in 'ABDBG-LEVENT'..

   For more info. put a break-point at where you want the module name & find the corresponding variable which gives you the exact name..

   Let me know if you have any concerns ..

Regards,

Raghu

Read only

Former Member
0 Likes
1,114

I think the function SYSTEM_CALLSTACK gives you the information you are looking for