08-30-2012 10:38 AM
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.
08-30-2012 11:03 AM
Dear,
Please try to understand SM04 tcode in this tcode we can get connection type so I think you can get ur point.
08-30-2012 11:38 AM
Hi,
You can also refer the functions available in function group URFC.
08-30-2012 11:55 AM
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
08-30-2012 12:04 PM
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
08-30-2012 12:05 PM
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
08-30-2012 12:09 PM
08-30-2012 12:29 PM
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
08-30-2012 1:18 PM
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
08-30-2012 2:59 PM
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
08-30-2012 3:19 PM
- 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