Skip to Content
Author's profile photo Former Member

Debugging a RFC call using JCo API, Part-2


In my previous weblog Debugging a RFC call using JCo API I wrote about how to analyse the dump of RFC call. In case the result is not what is expected we can further drill down to debugging into the function module’s ABAP code.

In order to enable the ABAP debugging we need to call the function setAbapDebug(boolean) defined in JCO.Connection with true as parameter.

Code snippet:

This will launch the ABAP debugger in a separate window when the Java program is run.

ABAP debugger:


Further details about how to use the ABAP Debugger can be found at ABAP Debugger Documentation.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      also in production scenarios(when setAbapdebug(true) cannot be turned on) if in some cases the ABAP processing initiated from java is under some sort of infinite loop then navigate to SM50 click on the rogue work process and initiate debugging through menu Program -> Debugging
      Author's profile photo Former Member
      Former Member
      I tried to start debug ABAP code from java by placing a statement mConnection.setAbapDebug(true), but still it doesn’t show the expected results.

      Are there any pre-requisites to be done, like starting ABAP RFC in debug mode or java program in debug mode. I tried both these options but didn’t get any result.

      Your help is greatly appreciated.

      The code is as follows :

                try {
                     mConnection = JCO.createClient("005", // SAP client
                     "TEST_USER", // userid
                     "initial", // password
                     "en", // language
                     "", // application server host name
                     "77"); // system number
                     mRepository = new JCO.Repository("test", mConnection);
                     JCO.Function function1 = this.createFunction("ZSTATUS_TRANSLATE");
                     function1.getImportParameterList().setValue("DONE", "IV_STATUS");

                     String output1 =     function1.getExportParameterList().getValue("EV_STATUS").toString();
                     System.out.println("The output of the RFC is "+output1);     
                catch (Exception ex)

      Author's profile photo Former Member
      Former Member
      The problem is solved by doing two settings :

      1) There is change in the code given in the blog, the connection.setAbapDebug(true) should be given before execution of the function.

      2) enabled external debugging in the backend, go to Utilities -> Settings -> Debugging and check the External Debugging check box, and enable HttpSession Debugging.

      This starts Abap Debugger :))

      Author's profile photo Former Member
      Former Member
      Just curious where you are setting external debugging as I don't have that on our backend we are on 4.6C is there a trxn code to start from or another screen besides the first one after log in

      Thanks so much 🙂