Skip to Content
imageimage

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:

image

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

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Pran Bhas
    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
    (0) 
  2. Bindu Madhavi J
    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
                   “us4456.wdf.sap.corp”, // application server host name
                   “77”); // system number
                   mConnection.connect();
                   mRepository = new JCO.Repository(“test”, mConnection);
                   JCO.Function function1 = this.createFunction(“ZSTATUS_TRANSLATE”);
                   function1.getImportParameterList().setValue(“DONE”, “IV_STATUS”);
                   mConnection.execute(function1);

                   mConnection.setAbapDebug(true);
                   String output1 =     function1.getExportParameterList().getValue(“EV_STATUS”).toString();
                   System.out.println(“The output of the RFC is “+output1);     
                   mConnection.disconnect();               
              }
              catch (Exception ex)
               {
                   ex.printStackTrace();
                   System.exit(1);
              }

    (0) 
    1. Bindu Madhavi J
      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 :))

      (0) 
      1. 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 🙂

        Cheers,
        Devlin

        (0) 

Leave a Reply