Skip to Content
Author's profile photo Michal Krawczyk

Michal’s Tips: AIF 3.0 – tRFC monitoring (using table ARFCSSTATE)

When an SAP backend system is being called from another SAP backend system with the use of tRFC currently we have no ways of monitoring errors in such integration scenarios. In case the tRFC call fails on the destination system in some cases the users on the calling system would like to:

a) know what kind of error occured in the destination system

b) restart the tRFC call without running the initial transaction

AIF 3.0 (new version available as of October 2014) offers a new functionality which can help to solve both of those issues. It’s now possible to create an AIF interface which will enable monitoring of tRFC calls which ended with an error on the destination system. Furthermore with AIF 3.0 it’s also possible to restart those errors and even debug the tRFC calls on the destination system directly from the calling system. Below you can find a list of steps required to customize such an integration scenario.

Step 1

Create an RFC enabled function module on the destination SAP backend system or use an existing one.

/wp-content/uploads/2015/01/1_rfc_dest_631040.png

Step 2

Create the AIF interface on the SAP backend system which will be calling remotely the RFC created on the destination SAP backend system from the previous step. You can create this new AIF interface by running a new, special report: /AIF/RFC_FUNC_GEN with the following parameters:

  • RFC Type – select – tRFC status table


  • Original RFC Function Name – the name of the RFC enabled function module which exists only on the destination SAP backend system (from Step 1)
  • Prefix of New Objects – prefix for the new created objects
  • Playback Function Name – this module will be created in the calling SAP backend system with the same signature as the original one from the destination . We need this module for the data transformation.
  • Name of AIF Structure – which will be automatically generated on the basis of the structure of the RFC enabled function module
  • Destination for Original Func. – this is the RFC destination of the SAP backend system on which the RFC enabled function module will be executed (destination SAP backend system)
  • Namespace – namespace of your new AIF interface
  • Interface Name – interface name of your new AIF interface
  • Interface Version – interface version of your new AIF interface

/wp-content/uploads/2015/01/2_trfc_generation_631041.png

Step 3

Execute the report/transaction on the calling SAP backend system which will send the data to the destination SAP backend system. Only if the tRFC call fails we will be able to monitor that call in AIF. In case the call is successfull we will not see any data in the AIF monitoring transactions. As you can see on the figure below the failed tRFC calls are visible in the AIF monitoring transaction and we can even monitor the data from the RFC structures (name, data, creator).

/wp-content/uploads/2015/01/3_call_failed_631042.png

Once the call failes as shown in the figure above we will be able to restart the call from AIF using the restart button or even debug the tRFC call using the debug button. Debugging will take the user from the calling SAP backend system to the destination SAP backend system on which the RFC module is being executed as shown in the figure below.

/wp-content/uploads/2015/01/4_trfc_debug_631043.png


Please keep in mind that once all tRFCs calls are successfully corrected all the entries from the AIF monitoring transaction will be gone and not marked as successfully completed as with other AIF scenarios.

Reference:


tRFC and qRFC – SAP Application Interface Framework – SAP Library

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Juan Janse
      Juan Janse

      Nice blog

      Author's profile photo Iñaki Vila
      Iñaki Vila

      Hi Michal,

      Definitely a really useful blog. Finally, we have a way to monitor the RFC. As per my understanding it can be used with PI scenarios with RFC receiver, isn't it?.

      Regards.

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog Post Author

      hi Iñaki Vila,

      You got me there... I don't know to be honest 🙂

      Will try to investigate and come back once I have the answer but a perfectly valid question,

      Thank you,

      Regards,

      Michal Krawczyk

      Author's profile photo Former Member
      Former Member

      Hi Michal,

      Is there Some configuration missing in this article after step 2 and step 3?

      Please suggest on below.

      After the Structure and Playback FM are generated. How do we trigger the AIF ?

      What did you mean by Execute the report/transaction on the calling SAP backend system which will send the data to the destination SAP backend system?


      Is that the  /AIF/TRANSFER? or any custom report?

      Could you please give detail idea on the RFC monitoring steps after the Structure generation.?



      Thanks in Advance.

      Shanmukh Srinivas

      Author's profile photo Former Member
      Former Member

      Hi Michal,

      what kind of errors are recognized by AIF. Only Dumps or can we tell it to also monitor "business errors" in case of wrong/ inconsistent data?

      Regards,

      Florian Barth

      Author's profile photo Pradnesh Nikam
      Pradnesh Nikam

      Hi Michal,

      This will only capture the connection issues we face while connecting to destination system , right?

      Issues which we can see in SM58, are logged into AIF Log, correct.

      Regards,

      Pradnesh Nikam

      Author's profile photo Former Member
      Former Member

      Hello Michal,

      Thank you for sharing this link, it was very helpful for me to understand function module generation. I'm looking for SAP PO-AIF integration through RFC, could you please guide us on same? my SAP PO is java stack server which won't support trfc. It will be very helpful if I get any pointers on same.

      1. FM created that takes 2 strings as input and gives 1 string as output. Also update table in background. An error is through if any string is initial or table record not found in database.
      2. SAP PO calling that RFC, but not logging error through AIF

      we need a solution for this AIF PO integration through RFC so that real business scenario can be implemented for SAP SD/MM module for business.

       

      Thanks and regards,

      Nikita

      Author's profile photo Senthilkumar Moorthy
      Senthilkumar Moorthy

      Hi Michal,

      I have scenario where we are having an RFC based Web Service and we have to integrate AIF to monitor the incoming RFC call. Will this setup work for this scenario also ?

       

      Regards

      Senthil.