Skip to Content

Central Finance Tips and Tricks #2 – Test and Debug AIF Messages

Implementing a Central Finance system can be challenging with a number of BADI’s involved with customer specific requirements, and to fill gaps in the standard SAP solution. In addition, the data is mainly being transferred by SLT where it is not apparent how to go about testing and debugging individual messages.

As a team member on a Central Finance project a key skill is understanding the application interface framework, and having skills to test and debug it for troubleshooting purposes. For those new to AIF and Central Finance I’ll provide some tips in this post on how to accomplish this.

Set Interface as synchronous

To be able to debug, the related central finance interface needs to run synchronously for you to break into debug. Here are two options you can take:

  1. Create a run time configuration group TST for releases up to 1610 FP2 or if note 2597249 is in your system, otherwise create run time configuration group 401 in transaction /AIF/PERS_CGR 

    The run time group is used by the interface test tool transaction /AIF/IFTEST. When setting this up be sure that the indicators “Run scheduled” and “Schedule packages” are not active and set the “Runtime Cfg Active” flag.

  2. Same as above, create a run-time group of your choosing, set as synchronous and assign it to the interface in SM30 view V_CFIN_AIF_RT_CF. All message via SLT will use this so be weary when testing because parallel processing will not take place.

Dont forget to place a break-point in the code you are looking to debug, for example your implementation of BADI_FINS_CFIN_AC_INTERFACE.

Testing a Single AIF message using technical mode

Go to AIF Monitor FINS_CFIN_AIF_IFMON – Interface Monitor and navigate to the interface that you want to test.

On the next screen enter into technical mode

Double Click on the message that you want to test with and then click Generate Test File. Take note of the file number created.

Now go to transaction /AIF/IFTEST – Interface Test Tool and select the test file from the File Number drop down (or leave blank to search for multiple messages).

Click Search and double click the file no in the bottom screen to activate the data as a selection.

Once the data is activated select the icon “Read Data” and from the next screen, select the icon Process in XML Run Time

Changing the message content

To test various scenarios you can change the message payload content using the interface test tool. Simply double click on a SRC_DATA structure and change the content of any field or internal table. In the example below the ACCIT table data can be changed. Be sure to install note 2615089 so that the tool does not short dump for structures with over 400 fields.

Testing a Single AIF message using Restart Option

One alternative to using run time configuration groups is to switch to synchronous mode in debug by setting a break-point in class at line 50

/AIF/CL_APPL_ENGINE_XML-/AIF/IF_APPLICATION_ENGINE~RESTART

Jump to line 58 when break point is reached.

You can re-start any AIF message using, for example transactions FINS_CFIN_AIF_IFMON, FINS_CFIN_AIF_ERR or /AIF/XML_RESTART to reach this break point.

Final Points

This is by no means exhaustive of the options available to test and debug AIF messages but based on my experience are the most straight forward to use.

5 Comments
You must be Logged on to comment or reply to a post.
  • Hi Marc,

    Thank you for the detailed explanation. I was trying to debug the message from AIF/ERR monitor but the control moved to Background job automatically.

    I did NOT see  “Generate Test File” button in AIF/ERR monitor screen. Attached screenshot.

     

    Thanks

    • Hi Vicky,

      I suspect you probably have a missing authorization. Suggest you go to technical mode then run transaction SU53 to see if there are any missing authorizations reported and check with security team.

      Thanks

  • When trying to debug by entering a break-point in the Central Finance BAdI, it was executing a job instead. I debugged /AIF/IFTEST and found out it is looking for configuration group 401 instead of TST. /aif/cl_pers_config=>c_runtime_config_group-test_tool constant is set to 401 in form F_GET_RUN_CONF_FOR_TEST_TOOL (program FINS_CFIN_AIF_ACT_DOC_POST)

      SELECT SINGLE queue_ns queue_name FROM /aif/pers_rtcfgr INTO (cv_queue_ns, cv_queue_name)
        WHERE queue_ns = pv_if_ns
        AND   queue_name = /aif/cl_pers_config=>c_runtime_config_group-test_tool  AND active = abap_true. 
      IF sy-subrc <> 0.
        SELECT SINGLE queue_ns queue_name FROM /aif/pers_rtcfgr INTO (cv_queue_ns, cv_queue_name)
          WHERE queue_ns = '/AIF/'
          AND   queue_name = /aif/cl_pers_config=>c_runtime_config_group-test_tool AND active = abap_true.
        IF sy-subrc <> 0.
          CLEAR: cv_queue_ns, cv_queue_name.
        ENDIF.
      ENDIF.
    • Hi Alfonzo,

      Thanks for you comment. The blog was based on 1610 FP2. Since then SAP have made some changes. Runtime configuration group for the AIF test tool was hardcoded as TST, this changed if note 2597249 is in your system or you are on 1610 FP4 or higher.

      Note 2578106 – Usage Restriction for Runtime Configuration Groups 400 to 499 has details.

      I will update the blog details.

      Thanks