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: 

How to get caller system within called RFC enabled FM

Former Member
0 Kudos

Hello,

I'm writing a RFC (remote enabled) function module which will be called by different other SAP systems.
Within this called function module, I like to get the caller's system ID.

Is there any way to get this information, maybe a function module/table I can use for this purpose?

Thanks,

Stephan.

4 REPLIES 4

ThomasZloch
Active Contributor
0 Kudos

I suppose the easiest way would be just have SY-SYSID passed by the caller as an input parameter into your function module. I don't know of another way, and if there is one, it is probably much more complex.

Thomas

0 Kudos

Hello,

thanks for your response. Yes, I suppose as well that this is the most easiest way. But this has impact on all existing RFC partners and just those which I don't know. In other words: I need to investigate which caller is really connecting to my RFC enabled FM.

Yours
Stephan.

jack_graus2
Active Contributor
0 Kudos

Hi Stephan, you could call RFC destination BACK from within your RFC function module. Destination BACK calls the calling RFC system. When you call function module 'RFC_SYSTEM_INFO' the sytem ID will be returned in function module parameter RFCSI_EXPORT-RFCSYSID.

Here is an example:

  DATA rfcsi TYPE rfcsi.
  CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION 'BACK'
    IMPORTING
      rfcsi_export = rfcsi.

Best regards Jack

0 Kudos

Hi Jack,

Thanks. Your advice helped in my project too.

Best Regards

Aditya