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

How to get RFC Stack

0 Likes
2,521

Hi,

I want to get RFC stack in my RFC FM, to check from where it is being called. Is it possible? If yes, how?

Regards-

Chirag Keswani

7 REPLIES 7
Read only

matt
Active Contributor
2,073

Call FM RFC_SYSTEM_INFO from your FM, with destination 'BACK'.

Read only

0 Likes
2,073

Hi Matthew, thanks for a quick response. But the FM you mentioned just provides the system info, whereas I want the whole RFC object stack.

Read only

matt
Active Contributor
2,073

So write an RFC enabled FM that returns the stack, and call that.

Why do you want the stack anyway? What conceivable use will it be?

Read only

Former Member
0 Likes
2,073

Hi Chirag,

Not sure if this would solve your requirement, but you can call the function module 'SYSTEM_CALLSTACK' to get that information.

  data lt_call_stack type abap_callstack.
  data lt_sys_callst type sys_callst.

  call function 'SYSTEM_CALLSTACK'
    exporting
      max_level    = 100
    importing
      callstack    = lt_call_stack
      et_callstack = lt_sys_callst.

  if sy-subrc = 0.
    "Do somehting
  endif.

Cheers,

Rafael

Read only

0 Likes
2,073

Hi Rafael, thanks for your suggestions. I tried that, but it only gives the current system stack. It doesn't provide info of the RFC stack.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,073

What is a "RFC stack"?

Read only

0 Likes
2,073

Normally, we have an ABAP stack for any program. If we have a RFC FM called in that program, I want the Stack details of the caller program, in the remotely called FM.