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: 

System fields to identify a RFC call.

Former Member
0 Kudos

Hi,

Is their any system varibale available to identify if a update is happeing through RFC call?

Requirement :

We need to block a STO depending on certain conditions. This updation is happening in background through a RFC 'CIF_PO_INBOUND'.

I need to put a validation to see if its been called through RFC then need to block particular STO.

Please help.

10 REPLIES 10

bharat_rathod2
Active Participant
0 Kudos

Dear,

Please try to understand SM04 tcode in this tcode we can get connection type  so I think you can get ur point.

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

You can also refer the functions available in function group URFC.



0 Kudos

Kesav, Thanks for this useful information.

A wild guess, Importing parameter, IS_CTLPARAMS-LOGSRCSYS of CIF_PO_INBOUND function module (Logical system : Source system for transfer) can be used to identify sender system ?

Regards, Vinod

0 Kudos

Hi Vinod,

Nicely spotted, I feel that field will work. ex: LOGSRCSYS <> LOGDESTSYS ( true ).

I removed my previous comment, I felt that it will not work.

If its not from RFC call then what is the use of RFC_SYSTEM_INFO - DESTINATION "BACK", the documentation says "already" called. Will it work 

0 Kudos

Not sure if the following code wil not raise an uncatchable error CALL_FUNCTION_NO_SENDER when executed in non-RFC session ?

data: ls_rfcsi type rfcsi.

call function 'RFC_SYSTEM_INFO'

  destination 'BACK'

  importing

    rfcsi_export = ls_rfcsi.

Regards,

Raymond

0 Kudos

Hi Raymond,

The documentation says "already called by RFC".

0 Kudos

You are right Raymond.  http://help.sap.com/saphelp_nw73/helpdata/en/48/99b56fee2b73e7e10000000a42189b/content.htm

Regards, Vinod

P.S : I have slightly modified the call to RFC_SYSTEM_INFO as

CALL FUNCTION rfc_system_info DESTINATION 'BACK'

     IMPORTING rfcsi_export = wa_rfcsi

    EXCEPTIONS

       system_failure        = 1
      communication_failure = 2.


Now when called from a Non-RFC session, exception CALL_FUNCTION_NO_SENDER is been converted as COMMUNICATION_FAILURE which can be handled.  I not sure, whether it is a right coding practice to include the general RFC call exceptions during RFC function call, even though it is not mentioned in FM signature.


Message was edited by: Vinod Kumar

0 Kudos

Hi Vinod,

Depending on which filed of structure wa_rfcsi we can decide if it has been called by RFC or NOT?

The validation on STO has been implemented in one of the Exit. In this Exit i want to know if it has been called from RFC or not?

Regards,

Ravi

0 Kudos

If you get sy-subrc  = 2 (Communication failure)  for function module call 'RFC_SYSTEM_INFO',  function module is not called through RFC session,  Otherwise called system details will be available in RFCSI structure. 

You have to implement the FM call 'RFC_SYSTEM_INFO' & validation within the Remote enable function module, which is being called from external system.

I Feel, Your initial recommendation of using RFC_SYSTEM_INFO, is the better and generic solution.


Regards, Vinod

0 Kudos

- If RFC_SYSTEM_INFO raise an error -> not RFC

- Else can be a local RFC (like a CALL IN BACKGROUND TASK or STARTING NEW TASK) look at subfields like RFCSYSID vs SY-SYSID or  RFCDBHOST vs SY-HOST

Regards,

Raymond